Skip to content

Instantly share code, notes, and snippets.

@hiroy
Last active December 19, 2015 04:39
Show Gist options
  • Save hiroy/5898933 to your computer and use it in GitHub Desktop.
Save hiroy/5898933 to your computer and use it in GitHub Desktop.
Xcodeのgitを使っているときのpromptにブランチ名を表示するように
source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash
alias __git_ps1="git branch 2>/dev/null | grep '*' | sed 's/* \(.*\)/(\1)/'"
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWSTASHSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
GIT_PS1_SHOWUPSTREAM=auto
export PS1='\[\033[36m\]\u@\h\[\033[00m\]:\[\033[00m\]\w\[\033[34m\]$(__git_ps1)\[\033[00m\] \$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment