Discovering the Real Wrong Base
git log --oneline feature/party-snacks -4
A real, stale "Add spice experiments notes" commit sits right there in the ancestry — the tell-tale sign of branching from the wrong place.
The Real Three-Argument Rebase
git rebase --onto master old/spice-experiments feature/party-snacks
Read as: take everything on feature/party-snacks since it diverged from old/spice-experiments, and replay it directly onto master instead.
Confirming the Real Transplant
git log --oneline feature/party-snacks -4
The stale commit is genuinely gone — not hidden, not merged around, actually removed from this branch's real ancestry. Only the branch's own two real commits remain, now sitting directly on master.
A real, honest mistake: feature/party-snacks was branched from old/spice-experiments — a genuine, abandoned experiment nobody meant to build on top of — instead of master. Every real commit on party-snacks now carries that stale experiment along with it.
git rebase --onto is the real, three-argument form of rebase built exactly for this: "replay these commits, starting from where they actually diverged from the old base, directly onto this new one." One real command, and the stale base is gone entirely — not just hidden, genuinely removed from the branch's ancestry.
git rebase --onto <newbase> <oldbase> <branch>
The real, three-argument form of rebase: replays only the commits on <branch> that came after it diverged from <oldbase>, directly onto <newbase>. Confirmed directly in this lab: the stale old/spice-experiments commit was completely excluded from the result.
Takeaways
- git rebase --onto <newbase> <oldbase> <branch> is the real, three-argument form for transplanting a branch to a different base entirely
- Only the commits genuinely unique to <branch> (since it diverged from <oldbase>) get replayed — nothing from the old base comes along
- The named branch is transplanted directly without needing to be checked out first
- This block's full arc — squash, split, reorder, reword, judgment, and rebase --onto — is the complete real toolkit for presenting clean, honest history before opening a PR