Skip to content

Instantly share code, notes, and snippets.

@vagmi
Created April 29, 2009 09:04
Show Gist options
  • Save vagmi/103674 to your computer and use it in GitHub Desktop.
Save vagmi/103674 to your computer and use it in GitHub Desktop.
.bashrc to show git branch
# snip .bashrc
function bash_git_branch
{
git branch 2> /dev/null | grep \* | python -c "print '['+raw_input()[2:]+']'" 2> /dev/null
}
#snip .bashrc
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(bash_git_branch)\$ '
#snip the rest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment