4 ms·
When the entire structure of commits is called a tree, I find the name "branch" fitting. The branch is identified by its head commit, so the path from head to r
by mr_mitm 3y ago
When the entire structure of commits is called a tree, I find the name "branch" fitting. The branch is identified by its head commit, so the path from head to root is uniquely defined and that's the branch. (Disregarding merges for now.)
- cpeterso 3y agoLeaning into the tree metaphor (and following the precedent of other version control systems), git should have used the term trunk instead of master or main.
- hnarn 3y agoWhy? That would heavily imply that master/main is somehow technically different from all other branches (since a trunk is certainly not a branch), which to my knowledge is not true.
- cpeterso 3y agoI see what you mean, but don't "master" and "main" also imply some special authority? Trunk-based development with branches forking off and merging back into the trunk (a DAG, unlike a real tree! :) is an extremely common workflow. https://trunkbaseddevelopment.com/ https://trunkbaseddevelopment.com/
- Kuraj 3y agoBy following this metaphor, a trunk would be the original commit, whereas branches are the tree branch tips.
- galaxyLogic 3y agoAnd consider that because every folder can have its own .git subfolder, we can have several paralle trunks/repositories at the same time, meaning we have a forest. I haven't really seen specific guidelines as to when and why should anyone start a new repo. Are there some? Or is "mono-repo" the best solution, and when and for whom. Surely we need more than one git-repo in the whole world?!
- TeMPOraL 3y ago> Disregarding merges for now. Without disregarding them, it's not a tree, but a DAG.
- dayjaby 3y agoIt is a tree. What makes you think it's just a DAG? Are there commits with multiple parent commits or what?
- skrebbel 3y agoFWIW “tree” has a specific, different meaning in Git. It’s a file tracking the contents of a directory.
- lmm 3y agoWell yes if you disregard the thing that makes it not a tree then it is a tree. But you can't disregard that!