Enable git bash completion in OS X

October 16, 2011

Before proceeding, ensure that you have Xcode installed. This is a Homebrew requirement.

ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

brew install git bash-completion

Now edit your ~/.bash_profile and add the following:

if [ -f `brew --prefix`/etc/bash_completion ]; then
    . `brew --prefix`/etc/bash_completion
fi