Veröffentlicht am Samstag, 8 Juli 2023 How to show current git branch with colors in Bash prompt Kategorie Sonstiges A quick hack, for more information (for example colors) go to the source .Adding this to ~/.bashrc:parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' } export PS1="\u@\h \[\e[32m\]\w \[\e[91m\]\$(parse_git_branch)\[\e[00m\]$ "