Created
May 5, 2009 15:20
-
-
Save arnaudsj/107006 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
# Bash ~/.profile extract to display current git branch | |
# For Example: | |
# [email protected] ~/Development/MyProject | |
# 10:17:39 ^master $ | |
function parse_git_branch | |
{ | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo ${ref#refs/heads/} | |
} | |
declare -x PS1='\[\033[01;32m\]\u@\H \[\033[01;35m\]\w\n\[\033[00m\]\t \[\033[01;32m\]\[\033[01;30m\]^$(parse_git_branch)\[\033[01;32m\] \$\[\033[00m\] ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment