Why does a squash-merged branch show as unmerged to `git branch --merged`?
IntermediateConceptMerge, rebase and cherry-pick
Answer
Squash creates a new commit with no parent link to the feature commits, so the feature tip is not an ancestor of main. Git cannot see it as merged. Delete the branch with -D after confirming the PR merged, or use git cherry or git log --cherry to compare patch IDs, and enable auto-delete of head branches on GitHub.
git cherry -v main feature
More on Merge, rebase and cherry-pick
What is the difference between a fast-forward merge and a merge commit?BeginnerHow does a three-way merge work?IntermediateWhat does `git rebase` actually do?IntermediateMerge versus rebase: how do you decide?IntermediateWhat are squash merge, merge commit and rebase-and-merge on GitHub?IntermediateWhat does `git cherry-pick` do?Beginner