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

Multiple Rebase Conflicts

@  zq       empty
○  y          feat-2
○  unv
○  vw       Will conflict
○  xw
○  xl       Will conflict
│ ○  nz        merge-b
│ │ ○  m         merge-a
│ ├─╯
│ ○  vr       Base of merge-a and merge-b base
│ ○  r        Rebase here
│ ○  l        No idea why
├─╯
│ ○  no        feat-1
│ ○  vt
│ ○  s        Will conflict
│ ○  unm
│ ○  vz
├─╯
○  q         main
◆  zz   🔒  empty

Without further ado, rebase feat-2 on top of r:

Solution

jj rebase -s xl -o r

or

jj rebase -r xl:: -o r
@  zq       empty
×  y          feat-2
×  unv
×  vw       Will conflict
×  xw
×  xl       Will conflict
○  r        Rebase here
○  l        No idea why
│
~

Boom.

First Conflict

What's the conflict in xl?

Solution

jj show xl
Commit ID: efab44df7b62465e66edaec732f3a394090da0d3 Change ID: xlkttytwklswvptoywpyouywqwopyzzr Author : Arialdo (2026-07-06 17:47:05) Committer: Arialdo (2026-07-06 18:38:28)
    Will conflict

Created conflict in README.md:
    ...
   4    4: problem has finally been solved. This app lets you write things down
   5    5: and then cross them out. So cool.
   6    6:
   7    7: ## Features You Won't BeleiveBelieve
   8    8:
   9    9: - Adding tasks. You type words. They appear. Groundbreaking.
  10   10:
  11   11: - Completing tasks. Click a tiny box and watch your task get a line
  12   12:   through it, wich is basically like deleting it.
       13: <<<<<<< conflict 1 of 1
       14: %%%%%%% diff from: qmyyoorn bdcd7f2b (parents of rebased revision)
       15: \\\\\\\        to: roulqqom 67bb45ac "Rebase here" (rebase destination)
  13   16: +:quit
  14   17: +:qw
  15   18: +:wq
  16   19: +:q!
  17   20: +:x
  18   21: +:exit
  19   22: +:how to quit this editor?
  20   23: +:emacs
  21   24: +:emacs help
       25: +++++++ xlkttytw e08dfcc6 "Will conflict" (rebased revision)
       26:
       27: - Filters. All, Active, Completed. Choose your poison.
       28:
       29: - Inline editing. Made a typo? Double-click and fix it. So cool!
       30: >>>>>>> conflict 1 of 1 ends

Ha, that's embarrassing! Turns out that in Change r I was wrestling with Vim and accidentally mangled README.md. Oh well, I'm an Emacs user, but I should at least learn how to quit Vim.

You could resolve the conflict in x, but why keep those messy Vim commands in README.md? Why not tidy r up directly? Let's do that applying the conventional mini-workflow:

jj new r
jj restore -f r- README.md
jj squash


@ r           empty
│ ×  y          feat-2
│ ×  unv
│ ×  vw       Will conflict: deleted file
│ ○  xw
│ ○  xl       Will conflict: Vim
├─╯
○  r        Rebase here
○  l        No idea why
│
~

Cool! That solved the problem in xl and the resolution propagated to xw too.

This is probably your first time resolving a conflict without touching the conflicted commit itself.

There's still a conflict in vw. Time to tackle it.

Second Conflict

What is it about? If you inspect vw with jj show vw you will see:

Added conflict feat-2.js: 1: <<<<<<< conflict 1 of 1 2: %%%%%%% diff from: xwzyvpnm c8dcd10f (parents of rebased revision) 3: \\\\ to: xwzyvpnm c8dcd10f (rebased revision) 4: -import { useState } from "react"; 5: -import { Plus, Check, X } from "lucide-react"; 6: - [...] 104: -

105: -
106: - ); 107: -} 108: +++++++ vwqzzmtx 46b8d529 "Will conflict: deleted file" (rebased revision) 109: import { useState } from "react"; 110: import { Plus, Check, X, Pencil } from "lucide-react"; 111: [...] 306:
307: ); 308: } 309: >>>>>>> conflict 1 of 1 ends

which is how Jujutsu tells you:

Interesting! Who deleted feat-2.js?

jj log -r 'files("feat-2.js")'

×  y          feat-2
~  (elided revisions)
@  vw       Will conflict: deleted file
~  (elided revisions)
○  l        No idea why
○  q         main
│
~


jj show --summary q
...
A README.md
A feat-1.js
A feat-2.js

jj show --summary l
..

    No idea why

D feat-2.js

Here's the culprit!

@ r           empty
│ ×  y          feat-2
│ ×  unv
│ ×  vw       Will conflict: deleted file
│ ○  xw
│ ○  xl       Will conflict: Vim
├─╯
○  r        Rebase here
○  l        No idea why
│
~

Why did I do that? Well, the message says it all: I had no idea what I was doing... What if we remove that obviously mistaken Change?

Solution

jj abandon l

All clear!

○  y          feat-2
○  unv
○  vw       Will conflict: deleted file
○  xw
○  xl       Will conflict: Vim
○  r        Rebase here

Amazing! Solving a conflict by deleting past commits!