Skip to content

Instantly share code, notes, and snippets.

@leonardorb
Created October 10, 2012 15:18
Show Gist options
  • Save leonardorb/3866287 to your computer and use it in GitHub Desktop.
Save leonardorb/3866287 to your computer and use it in GitHub Desktop.
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/'
}
RED='\[\e[0;31m\]'
LIGHT_BLUE='\[\e[0;34m\]'
LIGHT_GRAY='\[\e[1;37m\]'
LIGHT_GREEN='\[\e[0;32m\]'
WHITE='\[\e[0;37m\]'
PS1="$LIGHT_GRAY\u$WHITE@\h:$LIGHT_BLUE\w$LIGHT_GREEN \$(parse_git_branch)$WHITE \$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment