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

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 →

  1. git rebase -i --exec "make build && make test" origin/main.
  2. Rebase stops at the first failing commit; fix it, git commit --amend, then git rebase --continue.
  3. 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.

All Git & GitHub questions Roadmap: Git & GitHub

More on Rebase, Cherry-pick and History Rewriting