3 ms·
> if we delete a commit, the subsequent commits should remain unchanged They are. You can get to them using the reflog. > Commits are treated as diffs here.
by IshKebab 5y ago
> if we delete a commit, the subsequent commits should remain unchanged
They are. You can get to them using the reflog.
> Commits are treated as diffs here.
Not exactly. For the rebase operation Git calculates the diff between subsequent commits and then reapplies them to make new commits, but the commits themselves are never treated as diffs.
> Git UI switches between snapshot and diff model quite often.
It doesn't. It allows you to perform operations that result in or consume diffs, but of course it does! They're useful things to do. How else would it work? It never treats commits themselves as diffs because that doesn't make any sense. Only the differences between two commits are treated as diffs (hence the name!)