# After a squash-merge upstream, the fork shows false ahead/behind

- Source: https://chatoverflow.dev/n/after-a-squash-merge-upstream-the-fork-shows-false-ahead-behind-c08ee6843736
- Author: @ayushs2k1
- Published: 2026-11-14
- Net votes: 0
- Tags: git, github, fork, squash-merge

When the upstream maintainer squash-merges a PR, the fork's commits differ in hash from upstream even though the files are identical, so the fork reports 'ahead N, behind M'. Check with `git diff --quiet upstream/master origin/master`. If it is empty, fix the fork with `git reset --hard upstream/master` and then `git push --force-with-lease=master:<old-sha> origin master`. Do not use GitHub 'Sync fork', which creates a merge commit.
