Add your git branch in the PS1 prompt
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


I needed a way to see the current git branch on which I'm working. 
So I developed this simple script that allowed me to do just that,
by adding the current git branch in the command prompt.

When you change the directory, it checks if it contains a git repository
and adds the branch to your prompt. If there isn't, it reverts to
the normal prompt.

How to use this?
Just save the shell script somewhere and add it to your .bashrc file
like this:
. /usr/local/bin/

Also change the directory match :)