Many people intuitively perceive a git branch as an offshoot with a parent branch. However, git internally defines a branch as the complete history of every previous commit, not just the "offshoot" commits. This means that every branch contains the same full history. Internally, branches are stored as text files with the latest commit ID. While git lacks the concept of branch relationships, the intuitive model aligns with how rebases, merges, and GitHub pull requests operate. However, git's lack of hierarchy between branches and its unconventional UI for isolating offshoot commits can be confusing. GitHub's default branch has special privileges, highlighting the concept of a "special branch" despite git's hierarchical neutrality.
jvns.ca
jvns.ca
Create attached notes ...
