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

Wrong Order

Sometimes it's not the changes that conflict: it's the order they end up in.

Use Case

○  h
○  g
│ ○  f  <- removes file README.md
│ ○  e  <- modifies file README.md
│ ○  d
│ ○  c
├─╯
○  b
○  a
◆
  • You rebase f on top of h:
$ jj rebase -r f -o h

○  f  <- removes file README.md
○  h
○  g
│ ○  e  <- modifies file README.md
│ ○  d
│ ○  c
├─╯
○  b
○  a
◆
  • Then you rebase e on top of f:
$ jj rebase -r f -o h

×  e  <- modifies file README.md
○  f  <- removes file README.md
○  h
○  g
│ ○  d
│ ○  c
├─╯
○  b
○  a
◆
  • Conflict

Solution

The two rebases result in e and f being swapped from their original order. An easy solution is to swap them again:

$ jj rebase -r e --before f

○  f  <- removes file README.md
○  e  <- modifies file README.md
○  h
○  g
│ ○  d
│ ○  c
├─╯
○  b
○  a
◆

And the conflict is gone.