What is a terminal without some colors these days? The git-prompt.sh script also supports this. All we need to do is set the GIT_PS1_SHOWCOLORHINTS variable to a nonempty value and, instead of using PS1, we need to use PROMPT_COMMAND. Let's change ~/.bashrc:
export GIT_PS1_SHOWUPSTREAM=auto export GIT_PS1_SHOWDIRTYSTATE=enabled export GIT_PS1_SHOWCOLORHINTS=enabled PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\$ "'
If we redo the same scenario as the previous one, we get the following: