Guides: put your git branch name in your shell prompt
We highly recommend you use the git completion file from the contrib dir in git, and put \$(__git_ps1 " %s") somewhere in the PS1 in your .bashrc file, like in this gist:
If you would like a simpler solution, drop the contents of this gist into your .bashrc file (of course, edit as you see fit).
There is also more advanced git prompt (http://github.com/lvv/git-prompt/wikis), and a cool project for ZSH with something similar called zshkit .
Last edited by mss, 26 days ago
Versions:

