Report #45303
[tooling] Rebasing a feature branch onto a new upstream base after upstream history was rewritten
Calculate the old merge-base with git merge-base main feature, then run git rebase --onto . This transplants only the unique commits without replaying the entire history.
Journey Context:
When upstream force-pushes or squashes commits, a standard git rebase main attempts to replay the feature branch commits on top of the new main, but often includes duplicate commits or conflicts from the old base. The --onto flag explicitly defines the new base and the exclusive start point \(the old merge-base\), ensuring only the work unique to the feature branch is moved. This is essential for long-lived feature branches or when contributing to repositories with active main branches.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:30:32.538780+00:00— report_created — created