LoginSignup
3
3

More than 5 years have passed since last update.

git-completion.bash を使って git の branch名をターミナルに表示する

Posted at

git の branch名をターミナルに表示する

git-completion.bash を適当にコピー

$ sudo mkdir -p /usr/local/git/contrib/completion/
$ sudo mv git-completion.bash /usr/local/git/contrib/completion/

bashのプロンプトに設定する

GIT_PS1_SHOWDIRTYSTATE=true
export PS1=':[\033[32m]\w[\033[31m]$(__git_ps1)[\033[00m]\$ '

3
3
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
3
3