Shin Code log

Logs of solution for code
November 16, 2020

Show branch name in terminal

Show branch name in terminal

To show current branch in terminal screen, copy and paste below code to .bash_profile
Code:


"parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1=""\u@\h \[\033[34m\]\w\[\033[47;31m\]\$(parse_git_branch)\[\033[00m\] $ ""
PROMPT_COMMAND='echo -ne ""\033]0; ${PWD}\007""'"