Merge Multiple Branches

jj does not have a merge command. Instead, use jj new followed by revision names. For example,

jj new rev1 rev2 rev3

Rebase a Single Change on top of Another

Rebase rev1 on top of rev2

jj rebase -r rev1 -d rev2

Squash Multiple Revisions

To squash multiple revisions, we can do the following:

jj squash --from "r1::rn" --into @
  • -f, --from <REVSETS> Revision(s) to squash from (default: @))
  • t, --into <REVSET> Revision to squash into (default @)
  • -i interactive
  • -u, --use-destination-message use destination’s message and discard all the other messages
  • --ignore-immutable need to use if we want to squash immutable revisions