5 ms·
In a DVCS like git, an important realisation is that commits are branches. Both a "regular" commit and a commit to a branch are just nodes on a DAG.
by eterm 3y ago
In a DVCS like git, an important realisation is that commits are branches.
Both a "regular" commit and a commit to a branch are just nodes on a DAG.
- stcroixx 3y agoIt’s statements like this among other that fuel git hate. Maybe this is true, I don’t know, but if it is, that’s terrible. To most working programmers these are not the same thing.
- eterm 3y agoCould you expand what you find hateful about that?
- dboreham 3y agoSome people hate tools that lack conceptual integrity.
- veddan 3y agoIn git a branch is a name that points to a commit. When you commit to a branch, you create a new commit and then update the branch to point to the new commit.
- tremon 3y agoIndeed. Which also invalidates the OP's claim that started this thread. No, commits are not branches: they lack a (repointable) name.
- eterm 3y agoThey don't, because they have a name (that also happens to be a hash). They lack a convenient name. You can go to any commit and "turn it into" a branch if you so wish by "promoting" it to a branch. My point is that there's no such thing as "avoiding branches" in git. Or least, you can't avoid the "downsides" of branches as some perceive it. Those issues are still present with commits, just without the convenience of good naming. That is to say, and I should have made it more clear in my initial comment, that trying to avoid branches is pointless and indeed counterproductive. You still logically have branches, without the convenience.