Here are a few very simple steps to enable git autocomplete on the command line for your bash shell. When it is working, you will be able to hit tab to autocomplete. This works for options as well (i.e., type in “git checkout –” and then hit tab).
To get this working, in your terminal, type:
curl “https://raw.github.com/git/git/master/contrib/completion/git-completion.bash” -o ~/.git-completion.bash
Or, if you would rather wget, you can type:
wget “https://raw.github.com/git/git/master/contrib/completion/git-completion.bash” -O ~/.git-completion.bash
Add this line to your ~/.bash_profile
In your terminal, type:
You’re good to go. Enjoy the git autocomplete!