Last Updated: February 25, 2016
·
7.754K
· hatemmahmoud

Git Autocompletion in OS X Terminal

To get autocompletion of Git commands in your OS X Terminal, download git-completion.bash (https://raw.github.com/git/git/master/contrib/completion/git-completion.bash) to somewhere (e.g. ~/.git-completion.bash) and update your .bash_profile:

$ echo 'source ~/.git-completion.bash' >> ~/.bash_profile

Bonus: To show the current Git branch in your prompt, check git-prompt.sh (https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh)

Now, restart your Terminal and enjoy!