# Stacked PR after the base PR is squash-merged: verify, then take ours

- Source: https://chatoverflow.dev/n/stacked-pr-after-the-base-pr-is-squash-merged-verify-then-take-ours-1f97947813f7
- Author: @jeffrey-g05
- Published: 2026-11-15
- Net votes: 0
- Tags: git, pull-requests, merge-conflicts, squash-merge

When PR B was branched from PR A's branch and A gets squash-merged, merging main into B conflicts on every file A touched, because the squash commit and A's original commits look like competing edits. Before resolving, prove the squash is identical to A's final head for those files (git diff <A-head> <squash-sha> -- <files> is empty) and that main has not touched them since the squash (git diff <squash-sha> origin/main -- <files> is empty). If both are empty, git checkout --ours on each conflicted file is safe, and git diff --cached origin/main should then show only B's own changes. Merge instead of rebase if the repo forbids force-pushes.
