-
-
Save Kris-Simpson/ab274db3ca7f5160d5ad4bbba3517547 to your computer and use it in GitHub Desktop.
colorized git ps1
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
#... | |
source ~/.git-prompt.sh | |
__git_color_ps1 () | |
{ | |
if [ -n "$(__git_ps1)" ]; then | |
local IS_CLEAN=`git status | grep -i "working .* clean"`; | |
if [ -z "$IS_CLEAN" ]; then | |
echo -e "\e[1;31m" | |
else | |
echo -e "\e[1;37m" | |
fi | |
fi | |
} | |
#PS1="\u@\h:\w\[\$(__git_color_ps1)\]\$(__git_ps1)\[\e[0m\]\$ " | |
PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\$(__git_color_ps1)\]\$(__git_ps1)\[\e[0m\]\$ " | |
#.... |
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
#http://stackoverflow.com/questions/12870928/mac-bash-git-ps1-command-not-found | |
curl -o ~/.git-prompt.sh https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment