Rebase

You can rebase a revision, branch or source onto/before/after another revision in the revision tree.

GIF

Pressing r enter the rebase mode and by default source is set to source and target is set to onto.

During rebase, there are source and target options that you can set to choose what type of rebase you want. Source defines which revisions you want to be rebased and target defines where and how you want to be rebased.

Source

revision

Can be set by pressing r. Only the selected revision will be moved to the target.

branch

Can be set by pressing B. All revisions in the branch of the selected revision will be moved to the target.

source

Can be set by pressing s. Selected revision and its descendants will be moved to the target.

Target

onto

Can be set by pressing d. Source revisions will be branched off the target revision.

image when applied: image

after

Can be set by pressing a. Source revision(s) will be placed after the target revision. image when applied: image

before

Can be set by pressing b. Source revision(s) will be placed before the target revision.

image

when applied:

image

insert

The revision that's selected by pressing i is set to be the --insert-after argument and the one that you have selected by pressing enter is going to be the --insert-before argument. Effectively running the following command:

jj rebase -r <the revision when r was pressed> --insert-after <the revision when i was pressed> --insert-before <revision when enter was pressed>

before:

image

after:

image