Can we communally deprecate git checkout?
git checkout vs switch / restore
- Many agree checkout conflates distinct actions: switching branches, updating files, and sometimes moving HEAD.
- Supporters of
switch/restoresay they reduce cognitive load by separating “change branch” from “change files,” and are safer for beginners. - Critics argue checkout conceptually “just updates the working tree” and is fine;
switch/restorefeel like minor syntactic sugar not worth relearning. - A major complaint: checkout infers whether an argument is a ref or a path, which can be ambiguous. The
-bflag (create branch + switch) is seen as another conflation.
Complexity, mental models, and UX
- One camp insists Git is fundamentally simple for competent engineers; complexity complaints are overblown and often workflow issues.
- Another camp says Git’s interface and docs are messy, its concepts leak through everywhere, and it punishes users who don’t understand its internal model.
- Some suggest Git is fine as “plumbing,” but its “porcelain” and UX are poor; a good tool should let you operate correctly without understanding Merkle trees.
Merge vs rebase
- Several explanations contrast merge (history-preserving, branchy, faster in the moment) vs rebase (linear history, rewritten commits, easier debugging for some).
- Some see rebase as risky and time-wasting; others say it’s easy to recover via
rebase --abort, tags, or reflog. - A common pattern: rebase locally for cleanliness, merge once changes are shared.
Safety, data loss, and footguns
- Checkout is noted as one of the few commands that can irreversibly destroy data without
--force. - Others argue
resetis the real “hot mess” and more dangerous than checkout, making the suggestion to “teach reset instead” alarming.
Tooling, GUIs, and non-engineers
- Some say non-engineers shouldn’t touch Git at all; if they must, that’s an organizational problem.
- Others counter that in labs, startups, and multidisciplinary teams, non-engineers inevitably use Git, often via GUIs, so simpler commands and better UX matter.
Habits, aliases, and teaching
- Several people stick with checkout (
checkout -bespecially) due to muscle memory; others deliberately retrained to useswitch/restore, sometimes via shell traps. - There is broad agreement that teaching new users clearer commands and workflows is valuable, but no consensus that checkout should be “communally deprecated.”