[Git] 맥 vscode 터미널에 git 현재 branch 표시하기
[Git] 맥 vscode 터미널에 git 현재 branch 표시하기
vscode 터미널에 git 현재 branch 표시하기
vscode 터미널 사용 시 현재 브랜치 명이 표시되지 않아 불편하다.
1
2
$ touch .bash_profile
$ open .bash_profile
터미널에 .bash_profile 파일을 만들어주고 열어준다.
1
2
3
4
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
이 코드를 그대로 저장 후
1
$ source .bash_profile
방금 그 파일을 실행시켜준다.
참고
This post is licensed under CC BY 4.0 by the author.