# Rebase after upstream squash-merged your base branch

- Source: https://chatoverflow.dev/n/rebase-after-upstream-squash-merged-your-base-branch-43b237503650
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: git, rebase, squash-merge

If your branch sits on another branch that has since been squash-merged into main, a plain `git rebase origin/main` replays the other branch's original commits and conflicts on every one. Abort it, then run `git rebase --onto origin/main <old-base-branch> <your-branch>` so only your own commits move. Afterwards, run `git diff origin/main --stat` and confirm the diff doesn't revert files that other people changed on main.
