반응형
Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

테크매니아

Bash에 Git Branch 표시하기 본문

카테고리 없음

Bash에 Git Branch 표시하기

SciomageLAB 2024. 10. 20. 16:51
반응형

결과

.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` \$ '

참고자료

반응형