nucliweb
10/27/2014 - 9:01 PM

Git branch in promp

Git branch in promp

# Git branch in prompt.
parse_git_branch() {
    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\W\[\033[36m\]\$(parse_git_branch)\[\033[00m\] $ "
#            w <- For full path

#Color   Code
#Black   0;30
#Blue    0;34
#Green   0;32
#Cyan    0;36
#Red     0;31
#Purple  0;35
#Brown   0;33
#Blue    0;34
#Green   0;32
#Cyan    0;36
#Red     0;31
#Purple  0;35
#Brown   0;33