Add git branch in prompt under Mac OSX

I found a article to do this:
http://www.phpvim.net/os/mac/git-branch-in-bash-prompt.html

It works.