4 ms·
Yes. It depends what you're doing. Most of the basic commands, they're snapshots. When you get into things like rebase especially, you have to think in terms o
by kadoban 3y ago
Yes.
It depends what you're doing. Most of the basic commands, they're snapshots. When you get into things like rebase especially, you have to think in terms of diffs.
I'm not sure what "histories" are, as a distinct thing from snapshots, kind of seems like the same thing.
- gavinhoward 3y agoI agree with you, just want to explain what a history is. A "history" is what other version control systems call a "branch." It's the commit and all of its ancestors. Some people think of things this way because the commit ID does depend on its ancestors by depending on its parent (which depends on its parent, which depends on its parent...). This is why, if you rebase a commit, and the content ends up exactly the same (maybe someone already made the equivalent change in both branches), the commit ID still changes: the parent has changed, so the hash changes, so the ID changes. I hope that makes sense.
- Evidlo 3y agoSnapshots and diffs aren't enough. They don't describe the DAG structure.
- GauntletWizard 3y agoThere's not a lot more to Git's DAG in a commit besides "Snapshot", "Comment", and "Pointer to previous commits". Even signatures are just a bit of porcelain to the data structure.
- cerved 3y agoRegarding rebase, I disagree. Thinking about a branch as a series of diffs can lead to a lot of unexpected outcomes