3 ms·
Simpler: PS1='\w$(git branch &>/dev/null; if [ $? -eq 0 ]; then echo "($(git branch | grep '^' |sed s/\\ //))"; fi)\$ '
by ichverstehe 19y ago
Simpler: 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.