以下、CentOS7/Amazon Linuxでの例です。
git-completion.bash と git-prompt.bashの入手
cd /tmp
git clone https://github.com/git/git.git
ファイルを設置
sudo mkdir -p /usr/local/git/contrib/completion
cd /tmp/git/contrib/completion
sudo mv * /usr/local/git/contrib/completion
.bashrcにて有効化する
source /usr/local/git/contrib/completion/git-prompt.sh
source /usr/local/git/contrib/completion/git-completion.bash
GIT_PS1_SHOWDIRTYSTATE=true
export PS1='\[\033[32m\]\u@\h\[\033[00m\]:\[\033[34m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ '
.bashrcの読み込み
source ~/.bashrc