Skip to content
Discussion options

You must be logged in to vote

Agreed that jj rebase -s is the way, there's no dedicated "add parent" command. A few tweaks, though:

  • Since 0.36 the flag is -o/--onto; -d still works as a deprecated alias. -o can be repeated, so you don't need the quoted revset:

    jj rebase -s M -o M- -o c
    
  • M- doesn't keep the original parent order. On jj 0.46, jj new a b gave parents a, b, and after the command above they were b, a, c ('M- | c' gave c, b, a). If the order matters to you (e.g. git log --first-parent), list the parents explicitly: jj rebase -s M -o a -o b -o c.

  • Use -s, not -r. -r M moves only M and rebases M's children onto a/b, so they lose M from their history.

Docs: https://docs.jj-vcs.dev/latest/cli-reference/#…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@josephlou5
Comment options

Comment options

You must be logged in to vote
1 reply
@JensRantil
Comment options

Answer selected by JensRantil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants