OT: git prompt

meik michalke meik.michalke at uni-duesseldorf.de
Wed Apr 25 14:00:25 UTC 2018


call me ignorant, but i only just found out about git-prompt.sh[*] and find it 
super useful. on debian/ubuntu you should be able to source it like this:

 source /usr/lib/git-core/git-sh-prompt

and add it to your prompt:

 PS1='\u@\h \w$(__git_ps1 " (%s)") $ '

then cd into a git repository -- the bash prompt should now show the current 
branch you're in. there's some more options you can activate by environment 

 export GIT_PS1_SHOWUPSTREAM="legacy verbose git"

this will then add more useful information like hom many commits you are 
behind/ahead of upstream or whether there's uncommited changed files.

viele grüße :: m.eik

[*] http://gitbu.ch/ch10.html (in german)
  dipl. psych. meik michalke
  institut f"ur experimentelle psychologie
  abt. f"ur diagnostik und differentielle psychologie
  heinrich-heine-universit"at d-40204 d"usseldorf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20180425/9c0347ca/attachment.sig>

More information about the rkward-devel mailing list