jj Verified current stable Not installed? Version Control

Jj / Split Revision Insert Before After

Split Revision Insert Before After

Use jj split to modify commit history by inserting revisions before and after specified points.

$
Terminal
jj split -r <revision> -B <revset> -A <revset>

When To Use

Modifying commit history for complex integration with precise branching control.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
jj split -r <revision> -B <revset> -A <revset>

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
Splitting revision 12345...
Inserting before revision 67890...
Inserting after revision 54321...
Split complete.

Power User Variants

Optimized versions

jj split -r 12345 -B 67890 -A 54321

Split revision 12345, inserting before 67890 and after 54321.

jj split --revision 12345 --insert-before 67890 --insert-after 54321

Same as above using long options.

Troubleshooting

Common pitfalls

Invalid revision specified

Solution: Ensure the revision exists in the repository.

Revset syntax error

Solution: Check the syntax of the revset provided.

Command Breakdown

What each part is doing

jj
Base Command
The executable that performs this operation. Here it runs Jj before the shell applies any redirect operators.
-r
r| revision
The value supplied for r| revision.
<revision>
revision
The value supplied for revision.
-B
B| insert before
The value supplied for B| insert before.
<revset>
revset
The value supplied for revset.
-A
A| insert after
The value supplied for A| insert after.
-r
Command Option
Tool-specific option used by this command invocation.
-B
Command Option
Tool-specific option used by this command invocation.
-A
Command Option
Tool-specific option used by this command invocation.

How To Run

Execution path

  1. Step 1

    Run `jj split -r <revision> -B <revset> -A <revset>` to split a revision.

  2. Step 2

    Specify the revision to split and the revsets for insertion points.

  3. Step 3

    Verify the changes in your commit history.

Alternative Approaches

Comparable commands in other tools

Alternative version control tools for the same job.