以下をコピペで実行すればよい。
プロンプトに __git_ps1
を追加する。
wget -q -O ~/.git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
wget -q -O ~/.git-prompt.sh https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
echo '. ~/.git-prompt.sh' >> ~/.bashrc
echo '. ~/.git-completion.bash' >> ~/.bashrc
echo 'RED="\[\033[0;31m\]"' >> ~/.bashrc
echo 'LRED="\[\033[1;31m\]"' >> ~/.bashrc
echo 'BLUE="\[\033[0;34m\]"' >> ~/.bashrc
echo 'GRA="\[\033[0;37m\]"' >> ~/.bashrc
echo 'GRE="\[\033[1;32m\]"' >> ~/.bashrc
echo 'WHITE="\[\033[1;37m\]"' >> ~/.bashrc
echo 'CLEAR="\[\e[m\]"' >> ~/.bashrc
echo 'PS1="${GRE}\h$GRA@$GRE\u$GRA:\w$GRE\$(__git_ps1)$GRA\$ $WHITE"' >> ~/.bashrc
. ~/.bashrc