4 ms·
Hmm, I don't have this issue. Perhaps because I use a two-line prompt? export PS1="\n\W\$(parse_git_branch) $ " parse_git_branch() { git branch 2> /de
by fictorial 14y ago
Hmm, I don't have this issue. Perhaps because I use a two-line prompt?
export PS1="\n\W\$(parse_git_branch) $ "
parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'; }
- Aissen 14y agoYou use a custom git parse branch, while git has a much more powerful prompt function : __git_ps1 . It's readily available in git's default bash_completion.d file. It shows the current branch, but also the state of the git tree (during rebase, am, bisecting, cherry-picking, etc.)