Nas
[GIT] 우분투 터미널 경로에 Branch 표시
Huninn
2019. 3. 16. 10:21
Git에 등록된 폴더로 진입했을때 폴도 경로에 Branch를 표시해주는 작업.
.bash 폴더를 만들어주고 진입한다.
mkdir ~/.bash
cd ~/.bash
.bash 폴더에 소스를 다운로드.
git clone git://github.com/jimeh/git-aware-prompt.git
.bash_profile 파일을 수정해준다. 파일이 없다면 만들어주면 된다.
vi ~/.bash_profile
#아래 소스를 추가.
export GITAWAREPROMPT=~/.bash/git-aware-prompt
source $GITAWAREPROMPT/main.sh
export PS1="\u@\h \w \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ "
소스를 적용한다.
source ~/.bash_profile