Hacker News new | ask | show | jobs
by zephjc 5110 days ago
This is cool, but every diagram I've seen for git history uses arrows pointing to the past instead of the future, which is a bit confusing.
4 comments

It represents the actual way commits are represented. Past commits cannot be modified to add children (this would change their hashes) so new commits contain references to parents. Changing this in diagrams would create even greater confusion later on.
The arrows do not represent time. Instead, they reflect the way git represents the commits internally. Each commit is a set of changes to some starting state, identified by the arrow. You could think of it like a citation in a paper that mentions and then extends some earlier findings.
Just think of it as a commit having a pointer to its parent.
This, in addition to knowing that a commit may have multiple parents (a merge commit, for example).
kisielk got it right, but to add:

A commit knows about its history via its parent(s), thus the arrow pointing to the parent. As far as I know no commit can (or for that matter should) know about its descendants.

Does that help?