Add autocomplete to Git commands in terminal

1. Download the completion script from Github

curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -OL
2. Add the following to your ~/.profile or ~/.bash_profile

source ~/git-completion.bash
alias gco='git co'
alias gci='git ci'
alias grb='git rb'
3. Add the following to your ~/.gitconfig

source ~/git-completion.bash
[alias]
co = checkout
ci = commit
rb = rebase
Restart Terminal and you are all set!
Advertisements