Tuesday, September 15, 2020

Show GIT Branch on Bash

ubuntu edit .bashrc
alpine linux .profile

show_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}

export PS1="\u@\h \[\e[32m\]\w \[\e[91m\]\$(show_git_branch)\[\e[00m\] $ "

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

ALCATEL 6900

write memory copy running certified reload from working no rollback-timeout