2 ms·
In a (very real) sense, git is an immutable data structure of immutable snapshots of code.
by Sharlin 1y ago
In a (very real) sense, git is an immutable data structure of immutable snapshots of code.
- ThunderSizzle 1y agoYou can do commit squashing in git, right? I know HG history editing wa much more of a pain than it seems to be in git.
- Sharlin 1y agoYes, but it just creates a new immutable branch in the commit graph. All the old commits are still there, but if they're not reachable from the root refs, they'll get GC'd eventually. The only mutable parts are HEAD, branch/tag names etc that can be changed to point to whatever. Anything that has a hash is necessarily immutable, because changing it in any way (including changing its parent pointer(s)) changes the hash.