4 ms·
I am glad no one told me that because I would have caused me a lot of confusion. Git branches, the thing the "git branch" give you are pointers to a commit, or
by GuB-42 4y ago
I am glad no one told me that because I would have caused me a lot of confusion.
Git branches, the thing the "git branch" give you are pointers to a commit, or refs if you wish. It has several implications: you can move them at will, and after a merge, you lose track of what "sequence of commits" it originally was.
I came to git from mercurial, and while they are fundamentally very similar, branches are a major difference because in mercurial, branches are really a named sequence of commits. Each commit of the branch is tagged with the branch name, and it will stay that way, even after a merge. You can't change or delete branches, only append to them or close them.
Git-style branches also exist in mercurial and they are called bookmarks, so maybe you can call them that.
Now there is the higher concept of branching that includes cloning and is not specific to git, and we can indeed call a branch a sequence of commits, but "git branches" have a precise meaning, and it is not that. Anyways, git is terrible at naming things, especially when it comes to its command line, one of the biggest flaws of an otherwise great version control system.
- alexvoda 4y agoMaybe the conclusion then is that when "higher concept of branching" means something, and other tools like mercurial align with that meaning, it is git that is wrong by using a different meaning. Git could have called their branches bookmarks too. If Bob insists on calling vodka "Bob water", and someone asks for some water to put out a fire and Bob gives them vodka, there is a problem even if "Bob water" has a precise meaning.