git auto-complete branches with checkout alias
I have this in my .bashrc which works okay:

alias gco="git checkout"
__git_complete gco _git_checkout


If you open up that neat script you'll see method names like __git_checkout. You can get completion for each of those methods using this method.

Unfortunately, commands like git pull don't play nice when you try to tab complete the branch name (the second argument), for example given this alias:

alias gpl="git pull"
__git_complete gpl _git_pull


This behavior occurs:

gpl origin master
      ^      ^
 tab ok      doesn't tab