Hacker News new | past | comments | ask | show | jobs | submit login

This feels like declaring squares aren't rectangles because you can make rectangles that aren't a square.



Git is only commits. Branches and tags are references to the commits; one moves while the other one doesn’t. That’s it.

Commits link to their parent(s) until the initial commit. You can visualize a “branch” as a series of commits, but the same thing can exist without calling it a branch:

    A -> B -> C —> Initial
Is that a branch? No. How about:

    /refs/heads/main = A
That’s a branch, and it looks exactly the same as a tag:

    /refs/tags/v1 = A
Neither a branch or a tag is “a series of commits” even if you think it does.


> You can visualize a “branch” as a series of commits, but the same thing can exist without calling it a branch

You can visualize a "square" as a rectangle with equal sides, but the same thing can exist without calling it a square.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: