Hi, I’ve accepted a pull request on GitHub through a squash and merge of the feature branch into the master branch:
v master v master
A -> A - - - - - - - E
- B - C - D - B - C - D
^ feature ^ feature
I then deleted the feature branch by clicking on the button that says so in the pull request, and was surprised to find out from the repository’s graph that the branch’s commits, not just the branch’s name, had been deleted. The repository’s graph, in Insights > Network on GitHub, now looks like that:
A - E
A branch, in Git, is a pointer to a commit, or so I’ve read countless times. I expected, and kinda wanted, to only delete this pointer, the branch’s name, leaving out the commits:
A - - - - - - - E
`- B - C - D
Unreacheable commits, granted, but still present, and accessible through their hash.
Is this behavior a bug or a feature of GitHub? If it is a feature, where else should I be cautious that the term “branch” is used to mean “the branch’s commits”? Or am I simply wrong in my understanding of what a branch means in Git?