Created
March 5, 2012 01:41
-
-
Save jamesmoriarty/1975916 to your computer and use it in GitHub Desktop.
git branch name in prompt
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
## | |
# Bash customizations | |
## | |
export CLICOLOR=1 # Enable color shell | |
export LSCOLORS=ExFxCxDxBxegedabagacad # Define colors | |
export COLOR_RED="\e[0;31m" | |
export COLOR_PINK="\e[35;1m" | |
export COLOR_NORMAL="\e[m" | |
__git_ps1 () | |
{ | |
local b="$(git symbolic-ref HEAD 2>/dev/null)"; | |
if [ -n "$b" ]; then | |
printf " (%s)" "${b##refs/heads/}"; | |
fi | |
} | |
export PS1="$COLOR_PINK\u$COLOR_NORMAL \w$COLOR_RED\$(__git_ps1 ' (%s)')$COLOR_NORMAL \$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment