LoginSignup
1
0

More than 5 years have passed since last update.

git の status をプロンプトに出す準備

Posted at

以下をコピペで実行すればよい。

プロンプトに __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

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0