Re:Display your current git branch as part of your bash prompt
by vicaya on Monday August 17, 2009 @05:11PM
(#769117)
It also shows the correct state of merge/rebase in the prompt as well. In many distributions, it's installed as /etc/bash_completion.d/git when you install git from a package management system, you just need to source /etc/bash_completion to get all the benefits.
The OP is an example of wheel reinvented, poorly.