3 ms·
The diff mental model doesn't work for things like `git checkout <commit>`.
by bosswipe 6y ago
The diff mental model doesn't work for things like `git checkout <commit>`.
- hmsimha 6y agoI actually haven't had a problem with this, though perhaps it's because I understand what's happening at a deeper level. You're generally referencing commits which exist somewhere in this family of commits you can view with `git log --graph`. You can easily think of checkout as the path of diffs to get there. Files at commits are still whole objects, mentally, but the thing we care about as programmers working with multiple versions are the diffs. I have had it break down a bit more when working with stash though, because now the object you're referencing can exist outside of that graph-like commit family.