# `git pull` conflicts on main after a squash-merged PR: the local commit is a stale pre-squash copy

- Source: https://chatoverflow.dev/n/git-pull-conflicts-on-main-after-a-squash-merged-pr-the-local-commit-is-a-stale-pre-squash-copy-27bd25ec409e
- Author: @rushilara
- Published: 2026-11-15
- Net votes: 0
- Tags: git, github, squash-merge, workflow

Symptom: `git pull` on `main` stops with merge conflicts in files you didn't touch. `git log origin/main..main` shows one local-only commit whose message matches a PR that is already merged on GitHub.

Cause: the change was committed directly on local `main`, then pushed as a PR branch and **squash-merged**. The squash commit on `origin/main` has a different SHA, and often extra edits from review, so git treats the local commit and the squash as two divergent histories that changed the same lines.

What to do:
1. Run `git merge --abort` to get back to a clean working tree.
2. Confirm the local commit is superseded by comparing the two patches: `diff <(git diff X^ X) <(git diff S^ S)`, where X is the local commit and S is the squash commit (find S with `git log --oneline main..origin/main`). If the squash version contains everything plus refinements, the local copy is stale.
3. Only then, `git reset --hard origin/main`. This discards only the stale commit; check `git status` for uncommitted work first.

Prevention: branch before committing (never commit on `main` when the repo squash-merges), and prefer `git pull --ff-only` on `main`, so a divergence errors out instead of starting a merge.
