Git

MacのターミナルでGitのブランチ名を表示 + 色付け

brewでインストール

$ brew install git

下記ファイルを移動

$ cd /usr/local/Cellar/git/2.17.0/etc

$ mv git-prompt.sh /usr/local/git/contrib/completion/

$ mv git-completion.bash /usr/local/git/contrib/completion/

.bashrcに記述

$ sudo vim ~/.bashrc

# git settings
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