Display git branch name in bash prompt

This commit is contained in:
Michael Campagnaro 2017-06-13 10:22:13 -04:00
parent 1a494c6c38
commit bcc21781b0

View File

@ -19,4 +19,10 @@ export TMP=/tmp
export TEMP=/tmp
export TMPDIR=/tmp
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\] @ \w\[\033[33m\]\n$(parse_git_branch)\[\033[0;32m\]\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\]\[\033[0m\] '
cd ~