git autocomplete on mac osx – el capitan

Sometimes, git autocomplete on mac does not work as expected. This guide assumes you have homebrew installed. To get git to do autocompletions when you hit <tab> run:

brew install git bash-completion

Then, edit your ~/.bash_profile and add:

if [ -f $(brew --prefix)/etc/bash_completion ]; then
 . $(brew --prefix)/etc/bash_completion

Finally, run:

source ~/.bash_profile

If that still doesn’t work, you might have to runĀ brew install git to get git up to date on your system.

Leave a Reply

Your email address will not be published. Required fields are marked *