A rebase of a branch with merge commits keeps replaying the same conflicts and resurrects old changes.
AdvancedTroubleshootingMerge and Rebase Problems
Answer
Likely causes → Default rebase flattens merge commits and re-applies every commit from both sides, so earlier hand-resolved conflicts reappear, and changes that were reverted can come back.
Diagnose →
git log --oneline --graph --merges origin/main..HEAD
git rev-list --merges --count origin/main..HEAD
Fix → Abort. Either keep the topology with git rebase --rebase-merges origin/main, or avoid rebasing: git merge origin/main. Another option is squash first (git reset --soft $(git merge-base HEAD origin/main), recommit) and rebase one commit. Enable rerere to remember resolutions.
Prevent → Do not merge main into a branch you plan to rebase; rebase it from the start.
More on Merge and Rebase Problems
Production failed to start, and the file contains `<<<<<<< HEAD` lines that were committed.Beginner`error: you need to resolve your current index first`Beginner`fatal: You have not concluded your merge (MERGE_HEAD exists).`BeginnerRebase stops: `error: could not apply 1a2b3c4... Add retry` and later `No changes - did you forget to use 'git add'?`Intermediate`fatal: It seems that there is already a rebase-merge directory, and I wonder if you are in the middle of another rebase.`Intermediate`CONFLICT (modify/delete): config/old.yml deleted in HEAD and modified in feature.`Intermediate