Skip to content

Instantly share code, notes, and snippets.

@herberthamaral
Created August 17, 2010 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save herberthamaral/529667 to your computer and use it in GitHub Desktop.
Save herberthamaral/529667 to your computer and use it in GitHub Desktop.
#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