June 06, 2008

can't remember your git branch?

I always have the problem remembering in which branch I am, and typing git branch all the time sucks, so just add this to your profile:

if [-e /etc/bash_completion.d/git] ; then
  source /etc/bash_completion.d/git
  export PS1='$(ppwd l)[email protected]:w$(__git_ps1 "(%s)")> '

And your prompt will look like this if you are in a git checkout:

[email protected]:/space/git/suse/zypp(master)>