Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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-1 branch on top of vr.

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 s

You 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 ends

A possible resolution is to replace the whole section with:

  // Handle theme color and mode

Then:

jj squash

Done!

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.