Skip to content

Set Parents

Press shift+m on a revision to enter set-parents mode. The revision’s existing parents are loaded automatically and marked << parent >>.

  • << to >>: the revision whose parents are being edited
  • << parent >>: existing parents (shown dimmed)
  • << add >>: revisions marked to be added as new parents
  • << remove >>: existing parents marked for removal

Navigate to any revision and press space to toggle it. Pressing space on a non-parent marks it << add >>; pressing it on an existing parent marks it << remove >>. Pressing space again un-marks it. Press enter to apply or esc to cancel.

This is how you create or dissolve merge commits — adding two parents creates a merge, removing one parent of a merge resolves it.

Under the hood runs:

jj rebase -s <target> -d "parents(<target>) ~ <removed...>" -d <added...>
  • space: toggle add/remove for the highlighted revision
  • enter: apply
  • esc: cancel
  • f: ace jump
  • @: jump to working copy
  • j/k, pgup/pgdown: navigation
Contribute Community