You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 25, 2025. It is now read-only.
# colors and prompt
__branch_color ()
{
if git rev-parse --git-dir >/dev/null 2>&1
then
if git diff --quiet 2>/dev/null >&2
then
color='\033[32m' # Green
else
color='\033[31m' # Red
fi
else
return 0
fi
echo -ne $color
}
if [ -f $HOME/.git-prompt.sh ]; then
source $HOME/.git-prompt.sh
txtwht='\e[0;37m' # White
PS1="[\u@\h \W\[\$(__branch_color)\]\$(__git_ps1)\[$txtwht\]]\$ "
fi
이렇게 하면 git 저장소 디렉토리에 들어가면 현재의 저장소의 브랜치명이 표시됩니다. commit할 내용이 있을 경우 빨간색으로, 없으면 초록색으로 예쁘게 표시되어 편리합니다. ^^;