this post was submitted on 09 Dec 2025
460 points (98.7% liked)
Programmer Humor
27898 readers
2254 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
it has always bothered me that checkout is overloaded: it can switch branches or discard pending changes in an unrecoverable way.
so, PSA, you can replicate the safe part of checkout with
git switchand the unsafe withgit restore.I agree, I wonder why they decided to design it that way in the first place.
Ah, I love coherent software.
Switch and restore came later because checkout was problematic.
Has someone made a „Checkout considered harmful“ blog post yet or do we not do that anymore?
E we used to always stash before checkouts to try and find things in a branch
Just alias stuff like that, make it coherent.