You squash-merged a PR, and `git branch -d feature` says the branch is not fully merged. Is something wrong?
IntermediateScenarioBranching and Merging Workflows
Answer
Situation read → Squash merge creates a new commit with different content ancestry. The original feature commits are not ancestors of main.
What I'd do →
- Confirm the PR shows as merged on GitHub and the squash commit is in
main. - Delete the branch with
git branch -D feature. - Turn on "Automatically delete head branches" in repo settings, and run
git fetch --prunelocally.
Why → -d checks ancestry, and squash breaks it. Content is merged but history is not.
Interview tip → Know the trade-off: squash gives clean history but makes -d, git branch --merged and later merges from the same branch unreliable.
More on Branching and Merging Workflows
You run `git pull` and Git stops with a merge conflict in `app.py`. What do you do?BeginnerYour feature branch is three weeks old and `main` has moved a lot. Merge `main` in, or rebase onto it?IntermediateThe team argues about fast-forward merges versus merge commits on `main`. How do you settle it?BeginnerA teammate branched from the wrong base, and their PR shows 40 unrelated commits. How do you fix it?IntermediateBefore merging, you want to see exactly what the feature branch adds compared to `main`. Which commands?BeginnerHalfway through a merge you realise you pulled the wrong branch. How do you back out?Beginner