A Branch Is A Pointer (Label) To One Commit
Named ReferenceTechnically, a branch is just a named reference that stores which commit it currently points to.
Core Git 3/8
A branch is a movable label attached to a commit. Creating a branch adds another label to the history, and each new commit moves that branch forward. Branches let teams isolate unfinished work and create separate lines of development without copying the repository.
Back to Git Concepts overviewTechnically, a branch is just a named reference that stores which commit it currently points to.
The branch label does not replace the history graph. It simply names one commit inside that graph. The commits themselves do not know branches exist, because branches do not contain commits; they only point to them.
Creating a branch does not create a new commit. Git simply adds another label, so
main and feature/ui can both point to the exact same commit
until one of them moves forward. Multiple branches can point to the same commit at the
same time.
After a branch is created, both branches still share the same history up to the split point. From there, each branch can receive new commits independently without affecting the other.