Install the git-prompt script using curl:
curl https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.git-prompt.sh
Load the git-prompt.sh
script in your ~/.bash_profile
Place these two lines in your bash_profile
source ~/.git-prompt.sh
PS1="\W\e[35;40m\$(__git_ps1) \e[0m$ "
export PS1
And you're done - you're bash prompt will now look like this:
~/git-flow (feature/feature_1234) $
:)