Living with Conflicts
Important
- You experience how conflicts won’t stop your work.
- You rebase a conflicted branch and commit on top of it.
Let’s start with a quiz!
Warning
Before resolving the conflict, can you rebase branch
vr::from its baseqontor?§ zo empty Merge conflict ├─╮ │ ○ nz **merge-b** ○ │ m **merge-a** ├─╯ ○ vr Base of merge-a and merge-b <- current base │ ○ y empty **feat-2** │ ○ vw empty │ ○ x empty │ ○ vn empty │ ○ r Rebase vr:: here <- rebase it here ├─╯ │ ~
Tip
Either specify the set:
jj rebase -r vr:: -o rOr use cut & paste points:
jj rebase -s vr -o r
Surprise surprise! The rebase succeeds.
Jujutsu won’t emit errors like Git’s:
fatal: It seems that there is already a rebase-merge directory, and
I wonder if you are in the middle of another rebase.
Jujutsu completed the rebase, yet the conflict persists, and you are reminded of that with:
Warning: There are unresolved conflicts at these paths:
file.txt 2-sided conflict
Again, it’s just a warning, not a showstopper. Which begs the question: can you commit on top of a conflicted Change? Why not!
jj new -m "My parent is conflicted"
jj new
echo "I can keep working" > some-work-file.txt
jj squash
§ l empty
× zm My parent is conflicted
× zo Merge conflict
├─╮
│ ○ nz **merge-b**
○ │ m **merge-a**
├─╯
○ vr Base of merge-a and merge-b
│
~
Jujutsu won’t forget about conflicts and will highlight them with red
× and @ symbols.
We’ve dragged our feet for too long. Time to resolve the conflict.