Monday, March 7, 2011

BASH Prompt in OSX with git branch

I found others doing the same.

Here is the content of my ~/.profile.


function parse_git_branch_and_add_brackets {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \[\1\]/'
}

PS1="\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[0;31m\]\$(parse_git_branch_and_add_brackets)\[\033[00m\]\\$ "

1 comment:

Anonymous said...

casino online - xn--o80b910a26eepc81il5g.online
casino online - xn--o80b910a26eepc81il5g.online. iphone -iphone -iphone -iphone -iphone -iphone -iphone -iphone -iphone jeetwin -iphone -iphone -iphone -iphone -iphone matchpoint -iphone -iphone. 우리카지노 쿠폰