Simply, add following lines to your ~/.bash_profile
:
branch_show() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(branch_show)\[\033[00m\] $ "
In this way, you can have the current branch name in Terminal
Courtesy of Coderwall.com