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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s