Archive for December, 2008
Git aware bash prompt
Posted on
December 9th, 2008 by
jason
No Comments
Browsing for something on the google earlier today, I ran across a way to set up a git branch aware bash prompt. It’s pretty slick if you are always in and out of git branches (if you’re not you should be)
First download git-completion.bash
http://repo.or.cz/w/git.git?a=blob_plain;f=contrib/completion/git-completion.bash;hb=HEAD
I saved it as ~/.git-completion.bash.
Next edit your ~/.bash_profile
Add
source ~/.git-completion.bash
PS1='\h:\W$(__git_ps1 "(%s)") \u\$ '
Finally source ~/.bash_profile to make zee changes active.
What results is this when you are in a git repository:
bigtex:jason(jquery_localize) jason$ git checkout master
Switched to branch "master"
bigtex:jason(master) jason$ git checkout jquery_localize
Switched to branch "jquery_localize"
bigtex:jason(jquery_localize) jason$
Moblog
Archives
- December 2009
- March 2009
- January 2009
- December 2008
- September 2008
- August 2008
- July 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- October 2007
- August 2007
- July 2007
- April 2007
