2 ms·
Technically, you're right. Practically however, it does make sense to implicitly dereference the branch you're talking about to the commit it points to. Asking
by seba_dos1 3y ago
Technically, you're right. Practically however, it does make sense to implicitly dereference the branch you're talking about to the commit it points to. Asking "is this commit on that branch?" is semantically equivalent to "is this commit reachable from the commit that branch points to?".
That said, it only makes sense to make such implicit mental shortcuts once you're already comfortable with git's data model. If you're not and you're still learning it, it's only going to confuse you.
- lakpan 3y agoTo be honest, describing a branch the wrong way is only going to confuse people more. The “dots on the line” visualization is pretty clear: you can have any number of branches pointing to a specific dot/commit. How do you add “branches” without fundamentally breaking that concept? When you create a branch, you’re not copying the line, you’re just adding a pointer.