Last active
July 20, 2017 14:42
-
-
Save ryaan-anthony/c862a2c22ad8eff7f368c15058c1e04e 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
black=$(tput setaf 0) | |
red=$(tput setaf 1) | |
green=$(tput setaf 2) | |
yellow=$(tput setaf 3) | |
blue=$(tput setaf 4) | |
magenta=$(tput setaf 5) | |
cyan=$(tput setaf 6) | |
white=$(tput setaf 7) | |
term_reset=$(tput sgr0) | |
git_branch() { | |
git symbolic-ref --short HEAD 2> /dev/null | awk '{print ":"$1}' | |
} | |
git_uncommitted() { | |
git diff-index --quiet HEAD 2> /dev/null -- && echo $green || echo $red | |
} | |
export PS1='\[$cyan\]\w\[$(git_uncommitted)\]$(git_branch) \[$term_reset\]\$ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment