Skip to content

Instantly share code, notes, and snippets.

@mikelikesbikes
Created July 21, 2009 17:32
Show Gist options
  • Select an option

  • Save mikelikesbikes/151479 to your computer and use it in GitHub Desktop.

Select an option

Save mikelikesbikes/151479 to your computer and use it in GitHub Desktop.
GREEN="\[\033[0;32m\]"
NC='\e[0m'
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
PS1="\W$NC $GREEN\$(parse_git_branch)$NC$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment