Skip to content

Instantly share code, notes, and snippets.

@swapi
Created August 13, 2013 13:00
Show Gist options
  • Save swapi/6220836 to your computer and use it in GitHub Desktop.
Save swapi/6220836 to your computer and use it in GitHub Desktop.
Bash PS1
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="\u@\h:\w\$(parse_git_branch) $ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment