Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrows pointing the wrong direction #70

Open
TheOfficialLoren opened this issue May 29, 2019 · 1 comment
Open

Arrows pointing the wrong direction #70

TheOfficialLoren opened this issue May 29, 2019 · 1 comment

Comments

@TheOfficialLoren
Copy link

Shouldn't the arrows between commits be pointing in the opposite direction? i.e., The arrow from the first commit should point to the 2nd commit. The 2nd commit should merge to the 3rd.

And during a merge, the arrow should point from the source branch to the target branch.

Or am I completely misunderstanding something?

@waldyrious
Copy link

@lorengphd that's a common issue that people have when trying to understand how git works. The direction of the arrows has to do with how the commits are linked together. Each commit in git points to the commit that preceded it (it can point to more than one, in the case of a merge commit). That information is available to the new commit when it's being created, but not to the older commit. (That would require knowing the future!)

Of course, git could simply edit the parent commit to point to the child commit, but the entire point of commits is that they're immutable. So the only way to link them is from child to parent, not the other way around.

Hope that helps! Let me know if anything is unclear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants