Skip to content

Instantly share code, notes, and snippets.

@williamsjj
Created August 26, 2009 17:29
Show Gist options
  • Select an option

  • Save williamsjj/175657 to your computer and use it in GitHub Desktop.

Select an option

Save williamsjj/175657 to your computer and use it in GitHub Desktop.
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# Add this to your PS1 as appropriate
"\[\033[1;31m\] $(parse_git_branch)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment