from: https://tecadmin.net/how-to-show-git-branch-names-in-your-bash-prompt/
vim ~/.bashrc
add the following:
#Function to show the current Git branch
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^]/d' -e 's/ (.*)/(\1)/'
}
#Custom PS1 prompt
export PS1="[\033[1;36m]\u[\033[1;31m]@[\033[1;34m]\h:[\033[1;35m][\e[32m]\w [\e[91m]\$(parse_git_branch)[\e[00m]$ "
load the new settings:
source ~/.bashrc