patternModeratepending
Git cherry-pick and rebase conflicts — resolution strategies
Viewed 0 times
merge conflictours vs theirsrebase conflictcherry-pick conflictrerere--abort
terminal
Problem
Cherry-pick or rebase stops with merge conflicts. The conflict markers are confusing — which side is 'ours' and 'theirs' changes meaning between merge, rebase, and cherry-pick.
Solution
(1) In merge: ours = your current branch, theirs = branch being merged. (2) In rebase: ours = the branch being rebased ONTO (upstream), theirs = your commits being replayed. This is the opposite of merge! (3) In cherry-pick: ours = your current branch, theirs = the cherry-picked commit. (4) Resolution strategies: git checkout --ours file (keep current), git checkout --theirs file (take incoming). (5) Use git rerere (reuse recorded resolution) to auto-resolve repeated conflicts. (6) Visualize: git log --oneline --graph --all to understand the history. (7) Abort if needed: git rebase --abort or git cherry-pick --abort.
Why
The meaning of 'ours' and 'theirs' flips in rebase because git replays your commits on top of the target — from git's perspective, the target is the current branch during replay.
Revisions (0)
No revisions yet.