Last active
January 29, 2016 11:00
-
-
Save simonlynen/5482581 to your computer and use it in GitHub Desktop.
git color and show branch
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
git config --global color.ui "auto" | |
__git_ps1 () | |
{ | |
local b="$(git symbolic-ref HEAD 2>/dev/null)"; | |
if [ -n "$b" ]; then | |
printf " (%s)" "${b##refs/heads/}"; | |
fi | |
} | |
export GIT_PS1_SHOWDIRTYSTATE=1 | |
export PS1='\[\033[03;32m\]\u@\h\[\033[01;34m\]:\w\[\033[02;33m\]$(__git_ps1)\[\033[01;34m\]\$\[\033[00m\] ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment