- # git completion with a script download from github
- source ~/git-completion.bash
- # alternative git completion via Apple
- # source /Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-prompt.sh
- # display current git branch in prompt
- alias __git_ps1="git branch 2>/dev/null | grep '*' | sed 's/* \(.*\)/(\1)/'"
- export PS1="\W\$(__git_ps1)\$ "
- # show branch name if changed
- export GIT_PS1_SHOWDIRTYSTATE=1