11
12

More than 5 years have passed since last update.

Macのコマンドプロンプトにgit branch名を表示

Last updated at Posted at 2014-10-14

http://app2641.hatenablog.com/entry/2013/05/30/103529
を参考に以下で設定

スクリプトのインストール
mkdir -p /usr/local/git/contrib/completion/
cd /usr/local/git/contrib/completion/
wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
chmod 755 git-*
~/.bashrc
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[1;32m\]\u@\h\[\033[00m\]:\[\033[1;34m\]\w\[\033[1;31m\]$(__git_ps1)\[\033[00m\]\$ '
11
12
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
11
12