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:
@ 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?
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: -