About two years ago, a change in work caused me to become a heavy git user. One of the most important changes I made to my bash setup was to change my prompt to multi line, detect whether I was in a git repo, include the branch in the prompt, and also include a summary of git status.
Very handy! (The check also makes sure I am in the repo part of the repo, and not, say, in its .git folder or other non-working folders.)
> One of the most important changes I made to my bash setup was to change my prompt to multi line, detect whether I was in a git repo, include the branch in the prompt, and also include a summary of git status.
Check out starship[1] if you haven't already. It's a prompt that does just this and more, and works across shells like Bash, fish, zsh, etc.
That's one I forgot to mention but I do use it a lot. I don't know if you know this but you can also do a substitution on the previous command. I often do something like `ssh root@proxmox01` and then `!!:s/1/2` which runs it again, but substitutes 1 for 2 and executes `ssh root@proxmox02`.
edit: I realize that example fails the speed test vs `ctrl+p, backspace, 2, enter`, but hopefully you can see the value.
[+] [-] blockloop|4 years ago|reply
[+] [-] dang|4 years ago|reply
Mastering Bash and Terminal - https://news.ycombinator.com/item?id=13400350 - Jan 2017 (180 comments)
[+] [-] PeterWhittaker|4 years ago|reply
Very handy! (The check also makes sure I am in the repo part of the repo, and not, say, in its .git folder or other non-working folders.)
[+] [-] heavyset_go|4 years ago|reply
Check out starship[1] if you haven't already. It's a prompt that does just this and more, and works across shells like Bash, fish, zsh, etc.
[1] https://github.com/starship/starship
[+] [-] agustif|4 years ago|reply
I don't feel at home at a terminal without it by now, so one of my first installs after brew ;-)
https://github.com/spaceship-prompt/spaceship-prompt
[+] [-] noahtallen|4 years ago|reply
I wasn’t sure about multi line at first, but really digging it now.
[+] [-] GloriousKoji|4 years ago|reply
[+] [-] e40|4 years ago|reply
[+] [-] klysm|4 years ago|reply
[+] [-] blockloop|4 years ago|reply
edit: I realize that example fails the speed test vs `ctrl+p, backspace, 2, enter`, but hopefully you can see the value.
[+] [-] Zababa|4 years ago|reply