خوب از اون جایی که بیشتر وقت رو توی ترمینال سر می کنیم من prompt رو در bashrc تغییرات کوچیکی دادم تا بدون نیاز به نصب zsh و powerline بشه همیشه از وضعیت گیت باخبر باشم:
PS1='[\u@\h \W]\$ \[\033[38;5;34m\]$(if_git)\[\033[0m\] '
if_git(){
if [[ -d "./.git" ]]; then
logo=""
cur_branch="$(git branch -a 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/')"
if [[ "$cur_branch" == " master" ]]; then
cur_branch=""
fi
if [[ "$(git status -s)" ]]; then
if [[ "$(\git status | \grep -i 'is ahead of')" ]]; then
commits_ahead=" $(\git status | \grep -i 'is ahead of' | awk '{ print $(NF - 1) }')"
else
commits_ahead=" "
fi
if [[ "$(git status -s | \grep '^ M\|^ D' | wc -l)" -gt "0" ]]; then
unstaged=" $(git status -s | \grep '^ M\|^ D' | wc -l)"
else
unstaged=" "
fi
if [[ "$(git status -s | \grep '^M\|^A\|^D\|^R' | wc -l)" -gt "0" ]]; then
staged=" $(git status -s | \grep '^M\|^A\|^D\|^R' | wc -l)"
else
staged=" "
fi
if [[ "$(git status -s | \grep '??' | wc -l)" -gt "0" ]]; then
untracked=" $(git status -s | \grep '??' | wc -l)"
else
untracked=" "
fi
echo " ${logo}${cur_branch} $unstaged $staged $untracked $commits_ahead "
else
if [[ "$(\git status | \grep -i 'is ahead of')" ]]; then
commits_ahead=" $(\git status | \grep -i 'is ahead of' | awk '{ print $(NF - 1) }') "
echo " ${logo}${cur_branch} $commits_ahead"
else
echo " ${logo}${cur_branch} "
fi
fi
fi ; return ;}