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

A cherry-pick hits conflicts and you are unsure about it.

BeginnerScenarioRebase, Cherry-pick and History Rewriting
Answer

Situation read → The target branch has diverged from where the commit was made.

What I'd do →

  1. git status shows the conflicted files; look at what the commit intended with git show <sha>.
  2. Resolve, git add, then git cherry-pick --continue.
  3. If it is too different: git cherry-pick --abort and ask whether a manual port is better.

Why → Cherry-pick is a three-way merge using the commit's parent as the base.

Interview tip → Heavy conflicts usually mean the fix needs a manual backport, not a mechanical one.

All Git & GitHub questions Roadmap: Git & GitHub

More on Rebase, Cherry-pick and History Rewriting