본문 바로가기
개발/환경구성

16.04/ bash에 현재 branch 정보 표시하기

by heidiee 2022. 5. 3.

bashrc 에 해당 정보 등록

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