You can think about a Git branch in 3 different ways. way 1: just the commits that "branch" off This is what you're probably thinking about when you `merge` or `rebase` a branch into another one. Git doesn't keep track of which branch another branch is "based" on though: that's why you have to run git merge main (you have to tell it which base branch to merge with!) You can see these commits with: git log main..BRANCHNAME way 2: every previous commit This is what git log BRANCHNAME shows you. When we say a commit is "on" a branch, we mean that it's somewhere in the history for that branch. way 3: just the commit at the end This is how git represents a branch internally. You can run: cat .git/refs/heads/BRANCHNAME to see the commit ID for the branch. That commit's parent (and grandparents, great-grandparents, etc) determine the branch's history.
https://cdn.masto.host/socialjvnsca/media_attachments/files/111/562/876/113/788/292/original/c491bdc79f22082a.png