Skip to content

Instantly share code, notes, and snippets.

@cyx
Created March 4, 2010 12:25
Show Gist options
  • Save cyx/321658 to your computer and use it in GitHub Desktop.
Save cyx/321658 to your computer and use it in GitHub Desktop.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="\[\033[1;33m\]\w\[\033[0;32m\] \$(parse_git_branch) $ \[\033[00m\]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment