Skip to content

Instantly share code, notes, and snippets.

@panweizeng
Created April 22, 2011 14:59
Show Gist options
  • Save panweizeng/936828 to your computer and use it in GitHub Desktop.
Save panweizeng/936828 to your computer and use it in GitHub Desktop.
show git branch name in prompt
PS1="[\u@\h:\W\[\033[0;32m\]\$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/')\033[0m]\$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment