Skip to content

Commit a2361c0

Browse files
committed
Add commands
1 parent 27f7d21 commit a2361c0

5 files changed

Lines changed: 320 additions & 0 deletions

File tree

‎assets/commands/index.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3821,8 +3821,12 @@ jj-interdiff.md
38213821
jj-log.md
38223822
jj-new.md
38233823
jj-next.md
3824+
jj-operation-abandon.md
38243825
jj-operation-diff.md
3826+
jj-operation-integrate.md
38253827
jj-operation-log.md
3828+
jj-operation-restore.md
3829+
jj-operation-revert.md
38263830
jj-operation-show.md
38273831
jj-operation.md
38283832
jj-parallelize.md
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# TAGLINE
2+
3+
abandon operations from Jujutsu's operation log
4+
5+
# TLDR
6+
7+
**Abandon a specific operation**
8+
9+
```jj operation abandon [operation-id]```
10+
11+
**Abandon an operation and all of its ancestors** (discard old history)
12+
13+
```jj op abandon ..[operation-id]```
14+
15+
**Discard recent operations** after restoring to an earlier state
16+
17+
```jj op restore [operation-id] && jj op abandon [operation-id]..@-```
18+
19+
**List operations** before choosing what to abandon
20+
21+
```jj op log```
22+
23+
**Garbage-collect** objects made unreachable by abandon
24+
25+
```jj util gc```
26+
27+
# SYNOPSIS
28+
29+
**jj** **operation** **abandon** _operation_
30+
31+
# PARAMETERS
32+
33+
_OPERATION_
34+
> The operation or operation range to abandon. Range syntax such as `..<id>` (ancestors through that operation) and `<id>..@-` (from that operation up to the parent of the current operation) is accepted.
35+
36+
**--help**
37+
> Display help information.
38+
39+
# DESCRIPTION
40+
41+
**jj operation abandon** (alias **jj op abandon**) removes operations from Jujutsu's operation log. Every mutating **jj** command records an operation; abandoning those records is how you shrink the log and make old commits, views, and predecessors eligible for garbage collection.
42+
43+
To discard **old** history, pass a range ending at the last operation you want gone: **jj op abandon ..<operation ID>** abandons that operation and all of its ancestors. Descendants of the abandoned operations are reparented onto the root operation so the remaining log stays connected.
44+
45+
To discard **recent** history after a restore, first run **jj op restore <operation ID>**, then **jj op abandon <operation ID>..@-**. Restore creates a new operation that points the repo at the earlier view; abandon then drops the now-unwanted later operations from the log.
46+
47+
Previous versions of a change (predecessors) are also discarded when they become unreachable from the operation history. The abandoned operations, commits, and other unreachable objects can later be collected with **jj util gc**. This is not **jj abandon**, which hides revisions in the commit graph rather than operations in the operation log.
48+
49+
# CAVEATS
50+
51+
Subcommand of **jj**. Operation IDs come from **jj op log**, not from **jj log**. Abandoning is not the same as **jj undo** or **jj op restore**: those create new operations; this removes operations. After a large abandon, run **jj util gc** if you want the on-disk objects reclaimed. Do not confuse this with **jj abandon**, which abandons revisions.
52+
53+
# INSTALL
54+
55+
```pacman: sudo pacman -S jujutsu```
56+
57+
```apk: sudo apk add jujutsu```
58+
59+
```zypper: sudo zypper install jujutsu```
60+
61+
```brew: brew install jujutsu```
62+
63+
```nix: nix profile install nixpkgs#jujutsu```
64+
65+
<!-- packages: 2026-09-11 -->
66+
67+
# SEE ALSO
68+
69+
[jj-operation](/man/jj-operation)(1), [jj-operation-log](/man/jj-operation-log)(1), [jj-operation-restore](/man/jj-operation-restore)(1), [jj-operation-revert](/man/jj-operation-revert)(1), [jj-abandon](/man/jj-abandon)(1), [jj-undo](/man/jj-undo)(1), [jj](/man/jj)(1)
70+
71+
# RESOURCES
72+
73+
```[Source code](https://github.com/jj-vcs/jj)```
74+
75+
```[Homepage](https://jj-vcs.github.io/jj/)```
76+
77+
```[Documentation](https://docs.jj-vcs.dev/latest/cli-reference/#jj-operation-abandon)```
78+
79+
<!-- verified: 2026-09-11 -->
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# TAGLINE
2+
3+
add an unintegrated Jujutsu operation to the operation log
4+
5+
# TLDR
6+
7+
**Integrate an operation** into the log
8+
9+
```jj operation integrate [operation-id]```
10+
11+
**Run a mutating command without integrating** it
12+
13+
```jj --no-integrate-operation [command]```
14+
15+
**Inspect the resulting repo** at that unintegrated operation
16+
17+
```jj --at-op=[operation-id] log```
18+
19+
**Restore the repo** to that unintegrated operation instead of integrating it
20+
21+
```jj op restore [operation-id]```
22+
23+
**Confirm it is (or is not) already in the log**
24+
25+
```jj op log```
26+
27+
# SYNOPSIS
28+
29+
**jj** **operation** **integrate** _operation_
30+
31+
# PARAMETERS
32+
33+
_OPERATION_
34+
> The operation to integrate. The ID is printed by a command that ran with **--no-integrate-operation**, or recovered after an interrupted/failed integrate.
35+
36+
**--help**
37+
> Display help information.
38+
39+
# DESCRIPTION
40+
41+
**jj operation integrate** (alias **jj op integrate**) makes an existing operation part of the operation log. By default, Jujutsu integrates every mutating command automatically. Integration can be skipped with the global **--no-integrate-operation** flag, or fail to complete after an internal error. This command is how you attach such an operation afterwards.
42+
43+
When **--no-integrate-operation** is given, the command still creates an operation object, but it is not linked into the log and the working copy is not updated. The command prints the resulting operation ID. Pass that ID to **jj --at-op** to inspect the resulting repo state, to **jj op restore** to make that state current, or to **jj op integrate** to append it to the log.
44+
45+
Running **jj op integrate** on an operation that is already visible in **jj op log** has no effect. **--no-integrate-operation** does not suppress side effects outside the repo; for example **jj git push --no-integrate-operation** still performs the push.
46+
47+
# CAVEATS
48+
49+
Subcommand of **jj**. The operation must already exist as an object; this command does not create one. Integrating does not undo or redo work — it only links the operation into the log. Side effects that already happened (network, working-copy writes from the original command) are not replayed or rolled back.
50+
51+
# INSTALL
52+
53+
```pacman: sudo pacman -S jujutsu```
54+
55+
```apk: sudo apk add jujutsu```
56+
57+
```zypper: sudo zypper install jujutsu```
58+
59+
```brew: brew install jujutsu```
60+
61+
```nix: nix profile install nixpkgs#jujutsu```
62+
63+
<!-- packages: 2026-09-11 -->
64+
65+
# SEE ALSO
66+
67+
[jj-operation](/man/jj-operation)(1), [jj-operation-log](/man/jj-operation-log)(1), [jj-operation-restore](/man/jj-operation-restore)(1), [jj-operation-show](/man/jj-operation-show)(1), [jj](/man/jj)(1)
68+
69+
# RESOURCES
70+
71+
```[Source code](https://github.com/jj-vcs/jj)```
72+
73+
```[Homepage](https://jj-vcs.github.io/jj/)```
74+
75+
```[Documentation](https://docs.jj-vcs.dev/latest/cli-reference/#jj-operation-integrate)```
76+
77+
<!-- verified: 2026-09-11 -->
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# TAGLINE
2+
3+
restore a Jujutsu repository to an earlier operation
4+
5+
# TLDR
6+
7+
**Restore the repo** to a specific operation
8+
9+
```jj operation restore [operation-id]```
10+
11+
**Inspect that operation first** without changing the current state
12+
13+
```jj --at-op=[operation-id] log```
14+
15+
**Restore only repo state and local bookmarks** (leave remote-tracking bookmarks)
16+
17+
```jj op restore --what repo [operation-id]```
18+
19+
**Find an operation ID**
20+
21+
```jj op log```
22+
23+
**Then drop the discarded recent operations** from the log
24+
25+
```jj op abandon [operation-id]..@-```
26+
27+
# SYNOPSIS
28+
29+
**jj** **operation** **restore** [_options_] _operation_
30+
31+
# PARAMETERS
32+
33+
_OPERATION_
34+
> The operation to restore to. Copy an ID from **jj op log**. Any unambiguous prefix is enough. Use **jj --at-op=**_id_ **log** (or **st**) to preview the repo at that operation before restoring.
35+
36+
**--what** _WHAT_
37+
> Experimental. Which portions of the local state to restore (repeatable). Default: `repo` and `remote-tracking`. `repo` is the jj repo state and local bookmarks. `remote-tracking` is remote-tracking bookmarks — omit it if you want to push after the restore without resetting those refs.
38+
39+
**--help**
40+
> Display help information.
41+
42+
# DESCRIPTION
43+
44+
**jj operation restore** (alias **jj op restore**) creates a **new** operation whose view matches an earlier operation. The working copy, bookmarks, and other recorded repo state go back to how they looked then, which effectively undoes every later operation. Later operations remain in the log until you abandon them.
45+
46+
This is time travel for the whole repository, not a commit-level restore. **jj restore** copies file contents between revisions; **jj op restore** replaces the current operation's view. **jj undo** walks back one (or a few) operations at a time; **jj op revert** applies the inverse of one operation. **jj op restore** jumps to a chosen snapshot.
47+
48+
Because restore records a new operation, you can undo the restore itself with **jj undo**. To actually delete the skipped recent history, follow with **jj op abandon <operation ID>..@-**.
49+
50+
# CAVEATS
51+
52+
Subcommand of **jj**. Operation IDs come from **jj op log**, not from **jj log**. Restore does not delete later operations; it adds one that points at the older view. **--what** is experimental. Skipping `remote-tracking` is the usual choice when you still want to push. Preview with **--at-op** before restoring a large jump.
53+
54+
# INSTALL
55+
56+
```pacman: sudo pacman -S jujutsu```
57+
58+
```apk: sudo apk add jujutsu```
59+
60+
```zypper: sudo zypper install jujutsu```
61+
62+
```brew: brew install jujutsu```
63+
64+
```nix: nix profile install nixpkgs#jujutsu```
65+
66+
<!-- packages: 2026-09-11 -->
67+
68+
# SEE ALSO
69+
70+
[jj-operation](/man/jj-operation)(1), [jj-operation-log](/man/jj-operation-log)(1), [jj-operation-revert](/man/jj-operation-revert)(1), [jj-operation-abandon](/man/jj-operation-abandon)(1), [jj-undo](/man/jj-undo)(1), [jj-restore](/man/jj-restore)(1), [jj](/man/jj)(1)
71+
72+
# RESOURCES
73+
74+
```[Source code](https://github.com/jj-vcs/jj)```
75+
76+
```[Homepage](https://jj-vcs.github.io/jj/)```
77+
78+
```[Documentation](https://docs.jj-vcs.dev/latest/cli-reference/#jj-operation-restore)```
79+
80+
<!-- verified: 2026-09-11 -->
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# TAGLINE
2+
3+
revert a single Jujutsu operation by applying its inverse
4+
5+
# TLDR
6+
7+
**Revert the current operation**
8+
9+
```jj operation revert```
10+
11+
**Revert a specific operation** (not necessarily the latest)
12+
13+
```jj op revert [operation-id]```
14+
15+
**Revert only repo state and local bookmarks**
16+
17+
```jj op revert --what repo [operation-id]```
18+
19+
**Find an operation ID**
20+
21+
```jj op log```
22+
23+
**Undo the last operation** (top-level equivalent for the latest)
24+
25+
```jj undo```
26+
27+
# SYNOPSIS
28+
29+
**jj** **operation** **revert** [_options_] [_operation_]
30+
31+
# PARAMETERS
32+
33+
_OPERATION_
34+
> The operation to revert. Default: `@` (the current operation). Copy an ID from **jj op log**.
35+
36+
**--what** _WHAT_
37+
> Experimental. Which portions of the local state to restore (repeatable). Default: `repo` and `remote-tracking`. `repo` is the jj repo state and local bookmarks. `remote-tracking` is remote-tracking bookmarks — omit it if you want to push after the revert without resetting those refs.
38+
39+
**--help**
40+
> Display help information.
41+
42+
# DESCRIPTION
43+
44+
**jj operation revert** (alias **jj op revert**) creates a new operation that applies the **inverse** of an earlier operation. The original operation stays in the log; the new one undoes its effect on the recorded repo view.
45+
46+
This is the operation-log analog of **jj revert** (which inverts a commit). Use it when you want to undo one command that is not necessarily the most recent. **jj undo** is the usual way to walk back the latest operation(s) one-by-one. **jj op restore** instead replaces the current view with a whole earlier snapshot, undoing every operation after that point rather than inverting a single one.
47+
48+
Default **@** means "revert the current operation", which is close to **jj undo** for a single step. To invert something older, pass its ID from **jj op log**.
49+
50+
# CAVEATS
51+
52+
Subcommand of **jj**. Operation IDs come from **jj op log**, not from **jj log**. Revert adds a new operation; it does not delete history. **--what** is experimental. This is not **jj revert**, which creates a new **commit** that undoes a revision. Inverting an operation that had effects outside the repo (for example a **jj git push**) does not un-push.
53+
54+
# INSTALL
55+
56+
```pacman: sudo pacman -S jujutsu```
57+
58+
```apk: sudo apk add jujutsu```
59+
60+
```zypper: sudo zypper install jujutsu```
61+
62+
```brew: brew install jujutsu```
63+
64+
```nix: nix profile install nixpkgs#jujutsu```
65+
66+
<!-- packages: 2026-09-11 -->
67+
68+
# SEE ALSO
69+
70+
[jj-operation](/man/jj-operation)(1), [jj-operation-log](/man/jj-operation-log)(1), [jj-operation-restore](/man/jj-operation-restore)(1), [jj-undo](/man/jj-undo)(1), [jj-revert](/man/jj-revert)(1), [jj](/man/jj)(1)
71+
72+
# RESOURCES
73+
74+
```[Source code](https://github.com/jj-vcs/jj)```
75+
76+
```[Homepage](https://jj-vcs.github.io/jj/)```
77+
78+
```[Documentation](https://docs.jj-vcs.dev/latest/cli-reference/#jj-operation-revert)```
79+
80+
<!-- verified: 2026-09-11 -->

0 commit comments

Comments
 (0)