Show git branch on prompt

Aus Laemmi´s Wiki
Zur Navigation springen Zur Suche springen

Edit .profile and add follow:

export PS1="\[\033[00m\]\u@\h\[\033[01;33m\] \w \[\033[31m\]\$( git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' )\[\033[00m\]$\[\033[00m\] "