Repository navigation
How do I add another parent to a Jujutsu commit? #10431
|
I understand that |
Replies: 2 comments 2 replies
|
Here is one way to do it, but I am curious if there are simpler ways: Assuming your working copy is the merge commit, ie. |
|
Agreed that
Docs: https://docs.jj-vcs.dev/latest/cli-reference/#jj-rebase |
Agreed that
jj rebase -sis the way, there's no dedicated "add parent" command. A few tweaks, though:Since 0.36 the flag is
-o/--onto;-dstill works as a deprecated alias.-ocan be repeated, so you don't need the quoted revset:M-doesn't keep the original parent order. On jj 0.46,jj new a bgave parentsa, b, and after the command above they wereb, a, c('M- | c'gavec, 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 Mmoves onlyMand rebases M's children ontoa/b, so they loseMfrom their history.Docs: https://docs.jj-vcs.dev/latest/cli-reference/#…