Created
February 18, 2009 15:28
-
-
Save svenfuchs/66380 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function __git_dirty { | |
local dirty RED NO_COLOR | |
RED="\033[0;31m" | |
NO_COLOR="\e[0m" | |
dirty=$(git diff-index --cached --quiet HEAD 2>/dev/null || echo "⚡") | |
if [ ! -z "$dirty" ]; then | |
echo "${RED}${dirty}${NO_COLOR}"; | |
return; | |
fi | |
dirty=$(git diff-index --quiet HEAD 2>/dev/null || echo "⚡") | |
[ -z "$dirty" ] && return | |
echo "${RED}${dirty}${NO_COLOR}"; | |
} | |
export PS1='\[\033]0;\w\007\]\u:\W$(__git_ps1 "/%s$(__git_dirty)")$ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment