Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#shows your current git branch in bash in blue. Very cool :)
#Put this at the end of your ~/.bashrc file under Linux
function bash_git_branch
{
git branch 2> /dev/null | grep \* | python -c "print '['+raw_input()[2:]+']'" 2> /dev/null
}
PS1="${debian_chroot:+($debian_chroot)}[\u@\h:\w]\[\033[1;34m\]\$(bash_git_branch)\[\033[0m\]\$"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.