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

You backported fixes by cherry-pick and now want to know which commits on `main` are still missing from `release/5.0`.

IntermediateScenarioRebase, Cherry-pick and History Rewriting
Answer

Situation read → SHAs differ after cherry-picks, so normal log ranges lie.

What I'd do →

  1. git cherry -v release/5.0 main lists commits on main with + (not in release) or - (equivalent patch present).
  2. Or git log --oneline --cherry-pick --right-only release/5.0...main.
  3. Review the + list and decide what to backport.

Why → Both commands compare patch-ids (a hash of the diff), not commit SHAs.

Interview tip → Patch-id matching breaks if conflict resolution changed the diff, so spot check.

All Git & GitHub questions Roadmap: Git & GitHub

More on Rebase, Cherry-pick and History Rewriting