I edited a bit @vankasteelj's stuff and made something like zsh, to react to git's changes
If there are some changes then the color changes to orange or whatever, like in zsh (or fish also, I don't know) so, to do that, you need to create a function
function changes_in_branch() {
if [ -d .git ]; then
if expr length + "$(git status -s)" 2>&1 > /dev/null; then
echo -ne "\033[0;33m$(__git_ps1)\033[0m";
else
echo -ne "\033[0;32m$(__git_ps1)\033[0m"; fi;
fi
}
and then simply just add that function to the PS1
stuff.
Just like this:
PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\] @ \[\033[0;36m\]\h \w\[\033[0m\]$(changes_in_branch)\n\[\033[0;32m\]└─\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\] ▶\[\033[0m\] '