Created
July 10, 2011 01:51
-
-
Save joecannatti/1074150 to your computer and use it in GitHub Desktop.
prompt
This file contains hidden or 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
RED="\[\033[1;31m\]" | |
YELLOW="\[\033[1;33m\]" | |
GREEN="\[\033[1;32m\]" | |
NOCOLOR="\[\033[1;0m\]" | |
function parse_git_branch { | |
ref="$(git branch 2> /dev/null | sed -n "/*/ p" | awk '{ print $2 }')" | |
if [ -n "$ref" ]; then | |
echo "("${ref#refs/heads/}")" | |
fi | |
} | |
PS1="$YELLOW[\@] $RED\w $GREEN\$(parse_git_branch)$RED$ $NOCOLOR" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment