News for hackers. Stuff that matters.
Re:Things I wish everyone knew about Git (Part I) by chronometry888 on Wednesday June 29, 2022 @05:26PM (#31925921)
But "save your changes before running a command that can clobber" is a pretty good strategy.
Re:Things I wish everyone knew about Git (Part I) by kjeetgill on Wednesday June 29, 2022 @08:33PM (#31927429)
Agreed though. I always start with teaching people. If you git add + git commit + git branch BACKUP everything you can very safely do anything you want. If you get confused it's trivial to get to a clean state by git reset --hard.

If you give people a way to get to a clean slate it removes a significant amount of the learning curve. In my experience, push/pull/fetch/log/diff are easy enough it's only really merge/rebase management that gets people caught up. Giving people a short fuck up -> undo -> retry cycle lets people learn pretty quick.