Using jj split
to create a merge commit
#5151
-
I would like to do this transformation using jj split:
As in, split A into two commits A' and C and make the commit graph look as above. The reason for this is that I would then want to rebase C on a remote branch and push the result to open a PR. Currently I duplicate the commit and rebase the copy. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I would do this in two steps. First, split A into A' and C: $ jj split
$ jj log
○ wxmwxkym cf27d17a
│ A
│
@ okmlklnu 56845831
│ C
│
○ urwtlokv cb7625b3
│ B Next, create the merge commit: # I'm using description() here to make it easier to see
# which commit is which
$ jj new -B description(A) -A description(C) -A description(B) -m M
$ jj log
○ wxmwxkym 16129332
│ A
│
@ owxwrlll f530545a
├─╮ (empty) M
│ │
○ │ okmlklnu 56845831
├─╯ C
│
○ urwtlokv cb7625b3
│ B |
Beta Was this translation helpful? Give feedback.
-
What's the point of commit |
Beta Was this translation helpful? Give feedback.
I would do this in two steps. First, split A into A' and C:
Next, create the merge commit: