5 ms·
Bash prompt with git status
- interpol_p 13y agoVery handy. Thanks for sharing this. I'm always a bit absent-minded regarding which branch I'm working on, so this is great. Note that the supplied code doesn't handle directories with spaces — I've added a comment on the gist relating to that. Also I prefer a more simple terminal without user and host, since I tend to do only local dev. I also use a bright emoji as terminating character instead of the $, so: "\w:$(git_branch_and_status) 🌕 " is my prompt (I realise some might find this horrific). Edit: also a maxlen > 12 is probably needed for those who tend to use a lot of wordy "feature/branches".
- sbilstein 13y agoI've updated the gist with some fixes. Thanks for looking out for the space issue. I was considering the skull and bones or a heart instead of $ but they sat sorta strangely on the line. I tend to start all my branch names with a JIRA Issue like LSS-488 or a Github issue number so that the various tools integrate. My branch names tend to be long for sharing but the only identifier I need when I'm sharing is the ticket ID.