https://github.com/magicmonty/bash-git-prompt#installation
ここにある通りなんだけど
* brew
でbash-git-prompt
を入れる
* ~/.bash_profile
でプロンプトを設定する
の2行程
brewでbash-git-promptを入れる
ついでに bash completion
も追加しておく
cli
brew update
brew install bash-git-prompt bash-completion
~/.bash_profileでプロンプトを設定する
~/.bash_profile
if [[ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]]; then
__GIT_PROMPT_DIR=$(brew --prefix)/opt/bash-git-prompt/share
source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh"
fi
[[ -f $(brew --prefix)/etc/bash_completion ]] && . $(brew --prefix)/etc/bash_completion