Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Git Branch in console prompt
function parse_git_branch
{
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
function proml
{
PS1="[\w\$(parse_git_branch)]$"
}
proml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment