3 ms·
> One of the biggest issue with git is that it uses both the snapshot model and the diff/patch model Git always uses snapshots. The diff thing is just a questi
by Hendrikto 3y ago
> One of the biggest issue with git is that it uses both the snapshot model and the diff/patch model
Git always uses snapshots. The diff thing is just a question of how this is exposed in the UI.
- goku12 3y agoThe tree state is saved as snapshots. However, operations like merging (3-way merge) and rebase are certainly based on diffs/patches. For example, consider the case of an interactive rebase where you delete a commit. If it was based on snapshots, only that commit should disappear. The changes introduced by that commit should remain in the subsequent snapshots/commits. However, that is not what happens. The change introduced by the commit disappears from all subsequent commits/snapshots. This means that all the subsequent snapshots are modified by subtracting the patch from the commit that was deleted.