Interview Prep/Git & GitHub/Rebase, Cherry-pick and History Rewriting

A rebase stops with "The previous cherry-pick is now empty". What do you do?

IntermediateScenarioRebase, Cherry-pick and History Rewriting
Answer

Situation read → The commit's change is already present upstream (someone applied the same fix), so replaying it yields nothing.

What I'd do →

  1. If it is truly a duplicate: git rebase --skip.
  2. To handle this automatically: git rebase --empty=drop origin/main.
  3. To keep it as an empty marker commit: git commit --allow-empty then continue.

Why → Git stops by default so you consciously confirm that nothing is lost.

Interview tip → Verify with git diff HEAD that the upstream content matches your intent before skipping.

All Git & GitHub questions Roadmap: Git & GitHub

More on Rebase, Cherry-pick and History Rewriting