Skip to content

Instantly share code, notes, and snippets.

@rowanmanning
Created October 25, 2012 13:31
Show Gist options
  • Save rowanmanning/3952562 to your computer and use it in GitHub Desktop.
Save rowanmanning/3952562 to your computer and use it in GitHub Desktop.
Git Autocompletion On Mac OS X

Git Autocompletion On Mac OS X

(based on this post which I don't like because they tell you to add a bash file to your home directory)

Run the following commands to begin:

cd /usr/local/bin && curl https://github.com/git/git/raw/master/contrib/completion/git-completion.bash -OL

Add the following to your ~/.profile or ~/.bash_profile (whichever one you have/use):

# Git Completion Stuff
source /usr/local/bin/git-completion.bash
alias gco='git co'
alias gci='git ci'
alias grb='git rb'

Add the following to your ~/.gitconfig:

[alias]
co = checkout
ci = commit
rb = rebase

Reopen the terminal window you want to use Git in :)

@samhicks
Copy link

you da best :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment