Re:Git Branches: Intuition and Reality
by Lornedon on Thursday November 23, 2023 @08:41PM
(#38399880)
No. There are leaves that aren't heads (for example, after you delete a branch, the old commits just lie around until someone deliberately cleans them up), and there are heads that arent' leaves (for example if you branch a new feature branch from main. The feature branch brances off of main, so main is not a leaf anymore)
Re:Git Branches: Intuition and Reality
by galaxyLogic on Friday November 24, 2023 @05:00PM
(#38408849)
> The feature branch brances off of main, so main is not a leaf anymore)
But "main" remains a "head" even though the feature branch "continues the graph" from it?
So there must be a difference between "Adding a new commit" and "Branching a new commit". I think I got it now. Thanks
Re:Git Branches: Intuition and Reality
by dasil003 on Saturday November 25, 2023 @08:58AM
(#38413540)
There’s no “branching a new commit” (except as syntactic sugar). Creating a branch creates a new head pointing to an arbitrary commit (even one that already has one or more heads). Committing creates a new commit and moves exactly one head forward to it.
Or are there such leaves which are not considered 'heads'?