Mac OSX でgitをauto-completionする


git-completion.bashをダウンロードする

curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash

~/.bash_profileを作成する

touch ~/.bash_profile

~/.bash_profileを修正する

vi ~/.bash_profile

if [ -f ~/.git-completion.bash ]; then
  . ~/.git-completion.bash
fi

~/.bash_profileの修正内容を有効する

source ~/.bash_profile

git branchを表示させる

こういう風にgit branchをターミナルに表示させる

以下のポストをご覧ください。
https://medium.com/@thucnc/how-to-show-current-git-branch-with-colors-in-bash-prompt-380d05a24745