이전 글목록 보기다음 글
git2026-09-11T01:41:10.309Z

git prompt style

Anya2_Forger profileAnya2_Forger
edited-Git-logo.png

1. .bashrc의 해당 부분을 수정하세요

아래 명령을 실행하세요.

vi ~/.bashrc

vi에서:

1) 맨 아랫줄에서 o 를 클릭하고, 다음을 추가하세요.

### git prompt
if [ -f /etc/bash_completion.d/git-prompt ]; then
    source /etc/bash_completion.d/git-prompt
    export GIT_PS1_SHOWDIRTYSTATE=1
    export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[01;33m\]$(__git_ps1 " (%s)")\[\033[00m\]\$ '
fi

2) 저장 : w

3) 나오기 : q


2. 수정한 .bashrc를 시스템에 적용하세요

source ~/.bashrc

Comments

Log in to comment

Loading comments...
이전 글목록 보기다음 글

당신의 이야기를 기다리고 있습니다