Created
January 26, 2012 08:54
-
-
Save DimitarChristoff/1681819 to your computer and use it in GitHub Desktop.
new git prompt
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_prompt { | |
local STATUS=`git status 2>&1` | |
if [[ "$STATUS" != *'Not a git repository'* ]] | |
then | |
if [[ "$STATUS" == *'working directory clean'* ]] | |
then | |
echo -e "\033[0;32m$(__git_ps1)\033[m" | |
else | |
echo -e "\033[0;31m$(__git_ps1)\033[m" | |
fi | |
fi | |
} | |
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(git_prompt) \$ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment