Skip to content

Instantly share code, notes, and snippets.

@nucliweb
Created October 27, 2014 21:01
Show Gist options
  • Save nucliweb/b66498d1d47606e6d53f to your computer and use it in GitHub Desktop.
Save nucliweb/b66498d1d47606e6d53f to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment