install git with git completion
Ref: install bash git completion
Mac OS X installation:
# install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install git
brew install git
# install bash-completion
brew install bash-completion
Once you have installed the git and bash-completion, add bash-completion to
your .bash_profile
# open .bash_profile
vim ~/.bash_profile
# add bash completion script to it
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion || {
# if not found in /usr/local/etc, try the brew --prefix location
[ -f "$(brew --prefix)/etc/bash_completion.d/git-completion.bash" ] && \
. $(brew --prefix)/etc/bash_completion.d/git-completion.bash
}
# save and exit vim
# reload the current
source ~/.bash_profile