3 ms·
Merge commits are a bit hard to understand from the perspective of "a commit is basically just a parent commit plus diff". On the flip side, cherry-picking is
by JoshuaDavid 6y ago
Merge commits are a bit hard to understand from the perspective of "a commit is basically just a parent commit plus diff".
On the flip side, cherry-picking is hard to understand from the perspective of "a commit is basically just a snapshot, nothing more" (it's _also_ weird from the parent-commit-plus-diff perspective -- cherry-pick is kind of a weird operation, but useful enough that we keep it anyway despite it not fitting quite as cleanly into the git model as other operations).
Outside those edge cases, though, people with "snapshot" and "parent + diff" mental models will make basically identical predictions about what the results of various operations with git will be.
- zaarn 6y agoThe solution is to think of it as "it's both, snapshot and parent + diff". When you cherry-pick, git is using the parent+diff model to move the commit. When you do a merge commit, it's using the snapshot model.