3 ms·
Bash Git prompt without Ruby
- graywh 19y agoToo complex. Try this one instead. http://news.ycombinator.com/item?id=163168 http://news.ycombinator.com/item?id=163168
- aggieben 19y agoThe reason I did it this way was because I had other uses for my rfind() function.
- ichverstehe 19y agoSimpler: PS1='\w$(git branch &>/dev/null; if [ $? -eq 0 ]; then echo "($(git branch | grep '^' |sed s/\\ //))"; fi)\$ '
- aggieben 19y agocool. 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.