Skip to content

Instantly share code, notes, and snippets.

@capoferro
Last active August 29, 2015 14:05
Show Gist options
  • Save capoferro/0f114f190ca5bd4116d3 to your computer and use it in GitHub Desktop.
Save capoferro/0f114f190ca5bd4116d3 to your computer and use it in GitHub Desktop.
git_color() {
color=$White
git tag 2> /dev/null > /dev/null && color=IRed
git diff --exit-code 2> /dev/null > /dev/null && color=IGreen
[[ "$(git_added_count)" != "0" ]] && color=IYellow
git_untracked || color=U$color
echo ${!color}
}
# Underline High Intensity
UIBlack='\e[4;90m' # Black
UIRed='\e[4;91m' # Red
UIGreen='\e[4;92m' # Green
UIYellow='\e[4;93m' # Yellow
UIBlue='\e[4;94m' # Blue
UIPurple='\e[4;95m' # Purple
UICyan='\e[4;96m' # Cyan
UIWhite='\e[4;97m' # White
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment