Improvement #1: adding the current branch name after the current path. Add this in your
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
export PS1='\[\e[0;32m\]\u\[\e[0m\]:\[\e[0;33m\]\w\[\e[0m\]\[\e[0;35m\]$(parse_git_branch)\[\e[0m\]$ '
And the outcome is
user:path (branch_name) $. The
user is green, the
path is yellow, the
branch_name is purple and everything else is white.
Improvement #2: autocompletion for branch names. Again, add this in your
if [ -f ~/.git-completion.bash ]; then
I find these pretty useful. Actually, I find them indispensable after a prolonged use. Don't forget to tweak the colors to your own preferences.