Created
November 30, 2012 23:53
-
-
Save forficate/4179611 to your computer and use it in GitHub Desktop.
Show current working SVN branch at bash 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
# Add the below to ~/.bash_profile | |
function parse_svn_branch { | |
# Note for mac users, use sed -nE 's/URL:.*\/(trunk|branches\/[^\/]*|tags\/[^\/]*).*/\1/p' | |
svn info 2> /dev/null | sed -rne 's/URL:.*\/(trunk|branches\/[^\/]*|tags\/[^\/]*).*/\1/p' | |
} | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
PS1="\u@\h \w$YELLOW \$(parse_svn_branch)$GREEN\$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment