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 →
git cherry -v release/5.0 mainlists commits onmainwith+(not in release) or-(equivalent patch present).- Or
git log --oneline --cherry-pick --right-only release/5.0...main. - 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.
More on Rebase, Cherry-pick and History Rewriting
Your PR branch has ten commits like "wip", "fix typo", "oops". How do you clean it up before review?BeginnerYou want the database migration commit to come before the code that uses it.BeginnerA critical fix on `main` must go to the `release/4.1` branch only.BeginnerYou must backport a feature made of 6 commits, including one merge commit.IntermediateBranch B was built on top of branch A. A was squash-merged into `main`, and now B shows A's commits again.IntermediateDuring review you get ten small change requests on old commits. How do you apply them cleanly?Intermediate