A Single Rebase Conflict
Important
You already know how to resolve a rebase conflict!
This chapter should be a mere formality. Challenge yourself.
○ so
○ o Merge conflict
├─╮
│ ○ nz **merge-b**
○ │ m **merge-a**
├─╯
○ vr Base of merge-a and merge-b base
│ ○ no empty **feat-1**
│ ○ vt empty
│ ○ sy empty
│ ○ u empty
│ ○ vz empty
├─╯
○ q empty **main**
◆ z 🔒 empty
Warning
Move the
feat-1branch on top ofvr.
Tip
jj rebase -s vz -o vr
Here we go: a conflict in s:
§ no **feat-1**
× vt
× s Will conflict
○ u
○ vz
○ r Rebase vr:: here
│
~
The conflict arises in s and propagates to all descendants.
Warning
How to resolve it? Remember the
jj new && (jj squash || jj restore)workflow from Don’t Edit.
Tip
jj new -r sYou will find this in
feat-1.js:<<<<<<< conflict 1 of 1 +++++++ unmwmutn 91e9daba "" (rebase destination) // This comment will get a conflict %%%%%%% diff from: unmwmutn e6f1eb22 "" (parents of rebased revision) \\\\\\\ to: nolxxptq 09ad5fbc (rebased revision) + // Handle theme color and mode >>>>>>> conflict 1 of 1 endsA possible resolution is to replace the whole section with:
// Handle theme color and modeThen:
jj squashDone!
If you got it right, good job! Watch the resolution propagate from s
down its descendants:
@ no **feat-1**
○ vt
○ s Will conflict
○ u
○ vz
○ r Rebase vr:: here
│
~
See? A walk in the park.