You rebased 12 commits and want to be sure every commit still builds.
IntermediateScenarioRebase, Cherry-pick and History Rewriting
Answer
Situation read → Rebase can leave intermediate commits broken even if the tip works.
What I'd do →
git rebase -i --exec "make build && make test" origin/main.- Rebase stops at the first failing commit; fix it,
git commit --amend, thengit rebase --continue. - For a CI check, run each commit:
git rebase --exec "./ci.sh" origin/main.
Why → Every commit being green keeps git bisect trustworthy.
Interview tip → Linux-style projects require "bisectable" series. Mention this as the reason.
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