

Bash Git prompt without Ruby - aggieben
http://bloggoergosum.us/2008/04/12/useful-git-prompt/

======
ichverstehe
Simpler: PS1='\w$(git branch &>/dev/null; if [ $? -eq 0 ]; then echo "($(git
branch | grep '^ _' |sed s/\_ \ //))"; fi)\$ '

~~~
aggieben
cool. I like that better. I didn't google before doing mine. Also, there was
some reason I didn't want to call 'git branch' twice, although now I can't
remember what it was.

So it goes with this kind of stuff.

------
graywh
Too complex.

Try this one instead. <http://news.ycombinator.com/item?id=163168>

~~~
aggieben
The reason I did it this way was because I had other uses for my rfind()
function.

