News for hackers. Stuff that matters.
Re:Oh Shit, Git? by atq2119 on Sunday August 16, 2020 @05:15PM (#24181395)
This is interesting. I find myself using checkout to check out individual files extremely rarely. It feels like a bit of an anti-pattern to me. What I do instead is commit the changes I intend to keep, using some interactive form of commit (usually git gui) followed by git reset --hard to remove whatever I don't want to keep.

The underlying rule is never to make destructive changes on a working directory that also has changes I intend to keep. This massively reduces the risk of data loss by accidental fat fingering of a command.

There are no comments on this comment yet.