Skip to content

Instantly share code, notes, and snippets.

@sethladd
Created October 16, 2009 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sethladd/211640 to your computer and use it in GitHub Desktop.
Save sethladd/211640 to your computer and use it in GitHub Desktop.
display git branch on prompt
parse_git_branch (){
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1='\[\033[0;33m\]\w\[\033[00m\]\[\033[01;00m\]$(parse_git_branch): '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment