테크매니아
Bash에 Git Branch 표시하기 본문
반응형
결과
.git
이 있는 디렉토리에서 아래 커멘드를 치면 git branch가 나온다.
$ echo `__git_ps1`
(main)
shell script __git_ps1()를 실행 시킨건데, 이건 /usr/lib/git-core/git-sh-prompt
에 구현돼 있다.
/etc/bash_completion.d/git-prompt
에서 참조된다.
PS1=' ... `__git_ps1` \$ '
참고자료
반응형