Generated with http://bashrcgenerator.com/
git_ps1 thanks to http://www.git-attitude.fr/2013/05/22/prompt-git-qui-dechire/#configurer-un%20prompt%20simple
To source from ~/.bashrc
with something like
# git prompt
[ -f ~/.git-prompt.sh ] && . ~/.git-prompt.sh