Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Put your git branch in your prompt (.bash_profile)
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="${TITLEBAR}\
$WHITE[$LIGHT_GRAY\w$GREEN\$(parse_git_branch)$WHITE]\
$GREEN\$ "
PS2='> '
PS4='+ '
}
proml
@wieczorek1990
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment