Question: Is there a way to bind hotkeys to textual commands in the terminal? For example: 
`ctrl+b == git branch <ret>`

Answer: 
[You can use the bash `bind` command](https://stackoverflow.com/a/4120926/634853) as seen in the linked Stackoverflow answer.

In your case, the command would be:

```
bind '"\C-b":"git branch\n"'

```

To make it stick from session to session then add it to your `~/.inputrc`

[Bash bind reference.](http://www.gnu.org/software/bash/manual/bashref.html#Bash-Builtins) (also available as `man bash`)
A program like xmacro may be of help:

```
 xmacrorec can be used to record mouse and keyboard events on any X11 display.
 .
 xmacroplay can be used to playback recorded events or send any other
 mouse/keyboard events you choose. It is very handy for scripting an
 X display - for example controlling a presentation in mgp or ultrapoint
 from a script, network connection...
 .
 xmacroplay-keys is a script to help use the above.

```

See [this question](https://askubuntu.com/questions/150122/how-to-create-a-unicode-combination-of-keys-by-pressing-one-key-simplify-unicod) and its answer for more details.