Debian Codegraph @

cli/tests/[email protected]

raw
1 ---
2 source: cli/tests/test_generate_md_cli_help.rs
3 description: "AUTO-GENERATED FILE, DO NOT EDIT. This cli reference is generated by a test as an `insta` snapshot. MkDocs includes this snapshot from docs/cli-reference.md."
4 ---
5
6 <!-- BEGIN MARKDOWN-->
7
8 # Command-Line Help for `jj`
9
10 This document contains the help content for the `jj` command-line program.
11
12 **Command Overview:**
13
14 * [`jj`↴](#jj)
15 * [`jj abandon`↴](#jj-abandon)
16 * [`jj absorb`↴](#jj-absorb)
17 * [`jj arrange`↴](#jj-arrange)
18 * [`jj bisect`↴](#jj-bisect)
19 * [`jj bisect run`↴](#jj-bisect-run)
20 * [`jj bookmark`↴](#jj-bookmark)
21 * [`jj bookmark advance`↴](#jj-bookmark-advance)
22 * [`jj bookmark create`↴](#jj-bookmark-create)
23 * [`jj bookmark delete`↴](#jj-bookmark-delete)
24 * [`jj bookmark forget`↴](#jj-bookmark-forget)
25 * [`jj bookmark list`↴](#jj-bookmark-list)
26 * [`jj bookmark move`↴](#jj-bookmark-move)
27 * [`jj bookmark rename`↴](#jj-bookmark-rename)
28 * [`jj bookmark set`↴](#jj-bookmark-set)
29 * [`jj bookmark track`↴](#jj-bookmark-track)
30 * [`jj bookmark untrack`↴](#jj-bookmark-untrack)
31 * [`jj commit`↴](#jj-commit)
32 * [`jj config`↴](#jj-config)
33 * [`jj config edit`↴](#jj-config-edit)
34 * [`jj config gc`↴](#jj-config-gc)
35 * [`jj config get`↴](#jj-config-get)
36 * [`jj config list`↴](#jj-config-list)
37 * [`jj config path`↴](#jj-config-path)
38 * [`jj config set`↴](#jj-config-set)
39 * [`jj config unset`↴](#jj-config-unset)
40 * [`jj converge`↴](#jj-converge)
41 * [`jj describe`↴](#jj-describe)
42 * [`jj diff`↴](#jj-diff)
43 * [`jj diffedit`↴](#jj-diffedit)
44 * [`jj duplicate`↴](#jj-duplicate)
45 * [`jj edit`↴](#jj-edit)
46 * [`jj evolog`↴](#jj-evolog)
47 * [`jj file`↴](#jj-file)
48 * [`jj file annotate`↴](#jj-file-annotate)
49 * [`jj file chmod`↴](#jj-file-chmod)
50 * [`jj file list`↴](#jj-file-list)
51 * [`jj file search`↴](#jj-file-search)
52 * [`jj file show`↴](#jj-file-show)
53 * [`jj file track`↴](#jj-file-track)
54 * [`jj file untrack`↴](#jj-file-untrack)
55 * [`jj fix`↴](#jj-fix)
56 * [`jj gerrit`↴](#jj-gerrit)
57 * [`jj gerrit upload`↴](#jj-gerrit-upload)
58 * [`jj git`↴](#jj-git)
59 * [`jj git clone`↴](#jj-git-clone)
60 * [`jj git colocation`↴](#jj-git-colocation)
61 * [`jj git colocation disable`↴](#jj-git-colocation-disable)
62 * [`jj git colocation enable`↴](#jj-git-colocation-enable)
63 * [`jj git colocation status`↴](#jj-git-colocation-status)
64 * [`jj git export`↴](#jj-git-export)
65 * [`jj git fetch`↴](#jj-git-fetch)
66 * [`jj git import`↴](#jj-git-import)
67 * [`jj git init`↴](#jj-git-init)
68 * [`jj git push`↴](#jj-git-push)
69 * [`jj git remote`↴](#jj-git-remote)
70 * [`jj git remote add`↴](#jj-git-remote-add)
71 * [`jj git remote list`↴](#jj-git-remote-list)
72 * [`jj git remote remove`↴](#jj-git-remote-remove)
73 * [`jj git remote rename`↴](#jj-git-remote-rename)
74 * [`jj git remote set-url`↴](#jj-git-remote-set-url)
75 * [`jj git root`↴](#jj-git-root)
76 * [`jj help`↴](#jj-help)
77 * [`jj interdiff`↴](#jj-interdiff)
78 * [`jj log`↴](#jj-log)
79 * [`jj metaedit`↴](#jj-metaedit)
80 * [`jj new`↴](#jj-new)
81 * [`jj next`↴](#jj-next)
82 * [`jj operation`↴](#jj-operation)
83 * [`jj operation abandon`↴](#jj-operation-abandon)
84 * [`jj operation diff`↴](#jj-operation-diff)
85 * [`jj operation integrate`↴](#jj-operation-integrate)
86 * [`jj operation log`↴](#jj-operation-log)
87 * [`jj operation restore`↴](#jj-operation-restore)
88 * [`jj operation revert`↴](#jj-operation-revert)
89 * [`jj operation show`↴](#jj-operation-show)
90 * [`jj parallelize`↴](#jj-parallelize)
91 * [`jj prev`↴](#jj-prev)
92 * [`jj rebase`↴](#jj-rebase)
93 * [`jj redo`↴](#jj-redo)
94 * [`jj resolve`↴](#jj-resolve)
95 * [`jj restore`↴](#jj-restore)
96 * [`jj revert`↴](#jj-revert)
97 * [`jj root`↴](#jj-root)
98 * [`jj run`↴](#jj-run)
99 * [`jj show`↴](#jj-show)
100 * [`jj sign`↴](#jj-sign)
101 * [`jj simplify-parents`↴](#jj-simplify-parents)
102 * [`jj sparse`↴](#jj-sparse)
103 * [`jj sparse edit`↴](#jj-sparse-edit)
104 * [`jj sparse list`↴](#jj-sparse-list)
105 * [`jj sparse reset`↴](#jj-sparse-reset)
106 * [`jj sparse set`↴](#jj-sparse-set)
107 * [`jj split`↴](#jj-split)
108 * [`jj squash`↴](#jj-squash)
109 * [`jj status`↴](#jj-status)
110 * [`jj tag`↴](#jj-tag)
111 * [`jj tag delete`↴](#jj-tag-delete)
112 * [`jj tag list`↴](#jj-tag-list)
113 * [`jj tag set`↴](#jj-tag-set)
114 * [`jj tag track`↴](#jj-tag-track)
115 * [`jj tag untrack`↴](#jj-tag-untrack)
116 * [`jj undo`↴](#jj-undo)
117 * [`jj unsign`↴](#jj-unsign)
118 * [`jj util`↴](#jj-util)
119 * [`jj util backend`↴](#jj-util-backend)
120 * [`jj util backend name`↴](#jj-util-backend-name)
121 * [`jj util completion`↴](#jj-util-completion)
122 * [`jj util config-schema`↴](#jj-util-config-schema)
123 * [`jj util exec`↴](#jj-util-exec)
124 * [`jj util gc`↴](#jj-util-gc)
125 * [`jj util install-man-pages`↴](#jj-util-install-man-pages)
126 * [`jj util markdown-help`↴](#jj-util-markdown-help)
127 * [`jj util snapshot`↴](#jj-util-snapshot)
128 * [`jj version`↴](#jj-version)
129 * [`jj workspace`↴](#jj-workspace)
130 * [`jj workspace add`↴](#jj-workspace-add)
131 * [`jj workspace forget`↴](#jj-workspace-forget)
132 * [`jj workspace list`↴](#jj-workspace-list)
133 * [`jj workspace rename`↴](#jj-workspace-rename)
134 * [`jj workspace root`↴](#jj-workspace-root)
135 * [`jj workspace update-stale`↴](#jj-workspace-update-stale)
136
137 ## `jj`
138
139 Jujutsu (An experimental VCS)
140
141 To get started, see the tutorial [`jj help -k tutorial`].
142
143 [`jj help -k tutorial`]: https://docs.jj-vcs.dev/latest/tutorial/
144
145 **Usage:** `jj [OPTIONS] [COMMAND]`
146
147 'jj help --help' lists available keywords. Use 'jj help -k' to show help for one of these keywords.
148
149
150 ###### **Subcommands:**
151
152 * `abandon` — Abandon a revision
153 * `absorb` — Move changes from a revision into the stack of mutable revisions
154 * `arrange` — Interactively arrange the commit graph
155 * `bisect` — Find a bad revision by bisection
156 * `bookmark` — Manage bookmarks [default alias: b]
157 * `commit` — Update the description and create a new change on top [default alias: ci]
158 * `config` — Manage config options
159 * `converge` — Converge divergent changes
160 * `describe` — Update the change description or other metadata [default alias: desc]
161 * `diff` — Compare file contents between two revisions
162 * `diffedit` — Touch up the content changes in a revision with a diff editor
163 * `duplicate` — Create new changes with the same content as existing ones
164 * `edit` — Sets the specified revision as the working-copy revision
165 * `evolog` — Show how a change has evolved over time
166 * `file` — File operations
167 * `fix` — Update files with formatting fixes or other changes
168 * `gerrit` — Interact with Gerrit Code Review
169 * `git` — Commands for working with Git remotes and the underlying Git repo
170 * `help` — Print this message or the help of the given subcommand(s)
171 * `interdiff` — Show differences between the diffs of two revisions
172 * `log` — Show revision history
173 * `metaedit` — Modify the metadata of a revision without changing its content
174 * `new` — Create a new, empty change and (by default) edit it in the working copy
175 * `next` — Move the working-copy commit to the child revision
176 * `operation` — Commands for working with the operation log
177 * `parallelize` — Parallelize revisions by making them siblings
178 * `prev` — Change the working copy revision relative to the parent revision
179 * `rebase` — Move revisions to different parent(s)
180 * `redo` — Redo the most recently undone operation
181 * `resolve` — Resolve conflicted files with an external merge tool
182 * `restore` — Restore paths from another revision
183 * `revert` — Apply the reverse of the given revision(s)
184 * `root` — Show the current workspace root directory (shortcut for `jj workspace root`)
185 * `run` — Run a command across a set of revisions.
186 * `show` — Show revision metadata and diff
187 * `sign` — Cryptographically sign a revision
188 * `simplify-parents` — Simplify parent edges for the specified revision(s)
189 * `sparse` — Manage which paths from the working-copy commit are present in the working copy
190 * `split` — Split a revision in two
191 * `squash` — Move changes from a revision into another revision
192 * `status` — Show high-level repo status [default alias: st]
193 * `tag` — Manage tags
194 * `undo` — Undo the last operation
195 * `unsign` — Drop a cryptographic signature
196 * `util` — Infrequently used commands such as for generating shell completions
197 * `version` — Display version information
198 * `workspace` — Commands for working with workspaces
199
200 ###### **Options:**
201
202 * `-R`, `--repository <REPOSITORY>` — Path to repository to operate on
203
204 By default, Jujutsu searches for the closest .jj/ directory in an ancestor of the current working directory.
205 * `--ignore-working-copy` — Don't snapshot the working copy, and don't update it
206
207 By default, Jujutsu snapshots the working copy at the beginning of every command. The working copy is also updated at the end of the command, if the command modified the working-copy commit (`@`). If you want to avoid snapshotting the working copy and instead see a possibly stale working-copy commit, you can use `--ignore-working-copy`. This may be useful e.g. in a command prompt, especially if you have another process that commits the working copy.
208
209 Loading the repository at a specific operation with `--at-operation` implies `--ignore-working-copy`.
210 * `--no-integrate-operation` — Run the command as usual but don't integrate any operations
211
212 When this option is given, the operations will still be created as usual but they will not be integrated to the operation log. The working copy will also not be updated.
213
214 The command will print the resulting operation ID. You can pass that to e.g. `jj --at-op` to inspect the resulting repo state, or you can pass it to `jj op restore` to restore the repo to that state. You can also pass the ID to `jj op integrate` to integrate the operation.
215
216 Note that this does *not* prevent side effects outside the repo. For example, `jj git push --no-integrate-operation` will still perform the push.
217 * `--ignore-immutable` — Allow rewriting immutable commits
218
219 By default, Jujutsu prevents rewriting commits in the configured set of immutable commits. This option disables that check and lets you rewrite any commit but the root commit.
220
221 This option only affects the check. It does not affect the `immutable_heads()` revset or the `immutable` template keyword.
222 * `--at-operation <AT_OPERATION>` [alias: `at-op`] — Operation to load the repo at
223
224 Operation to load the repo at. By default, Jujutsu loads the repo at the most recent operation, or at the merge of the divergent operations if any.
225
226 You can use `--at-op=<operation ID>` to see what the repo looked like at an earlier operation. For example `jj --at-op=<operation ID> st` will show you what `jj st` would have shown you when the given operation had just finished. `--at-op=@` is pretty much the same as the default except that divergent operations will never be merged.
227
228 Use `jj op log` to find the operation ID you want. Any unambiguous prefix of the operation ID is enough.
229
230 When loading the repo at an earlier operation, the working copy will be ignored, as if `--ignore-working-copy` had been specified.
231
232 It is possible to run mutating commands when loading the repo at an earlier operation. Doing that is equivalent to having run concurrent commands starting at the earlier operation. There's rarely a reason to do that, but it is possible.
233 * `--debug` — Enable debug logging
234 * `--color <WHEN>` — When to colorize output
235
236 Possible values: `always`, `never`, `debug`, `auto`
237
238 * `--quiet` — Silence non-primary command output
239
240 For example, `jj file list` will still list files, but it won't tell you if the working copy was snapshotted or if descendants were rebased.
241
242 Warnings and errors will still be printed.
243 * `--no-pager` — Disable the pager
244 * `--config <NAME=VALUE>` — Additional configuration options (can be repeated)
245
246 The name should be specified as TOML dotted keys. The value should be specified as a TOML expression. If string value isn't enclosed by any TOML constructs (such as array notation), quotes can be omitted.
247 * `--config-file <PATH>` — Additional configuration files (can be repeated)
248
249
250
251 ## `jj abandon`
252
253 Abandon a revision
254
255 Abandon a revision, rebasing descendants onto its parent(s). The behavior is similar to `jj restore --changes-in`; the difference is that `jj abandon` gives you a new change, while `jj restore` updates the existing change.
256
257 If a working-copy commit gets abandoned, it will be given a new, empty commit. This is true in general; it is not specific to this command.
258
259 **Usage:** `jj abandon [OPTIONS] [REVSETS]...`
260
261 ###### **Arguments:**
262
263 * `<REVSETS>` — The revision(s) to abandon (default: @) [aliases: -r]
264
265 ###### **Options:**
266
267 * `--retain-bookmarks` — Do not delete bookmarks pointing to the revisions to abandon
268
269 Bookmarks will be moved to the parent revisions instead.
270 * `--restore-descendants` — Do not modify the content of the children of the abandoned commits
271
272
273
274 ## `jj absorb`
275
276 Move changes from a revision into the stack of mutable revisions
277
278 This command splits changes in the source revision and moves each change to the closest mutable ancestor where the corresponding lines were modified last. If the destination revision cannot be determined unambiguously, the change will be left in the source revision.
279
280 With the `--interactive` option, only the selected changes will be considered for absorption. This allows picking specific hunks to absorb (which may then be distributed across multiple ancestors). The `--tool` option can be used to select a different diff editor.
281
282 The source revision will be abandoned if all changes are absorbed into the destination revisions, and if the source revision has no description.
283
284 The modification made by `jj absorb` can be reviewed by `jj op show -p`.
285
286 **Usage:** `jj absorb [OPTIONS] [FILESETS]...`
287
288 ###### **Arguments:**
289
290 * `<FILESETS>` — Move only changes to these paths (instead of all paths)
291
292 ###### **Options:**
293
294 * `-f`, `--from <REVSET>` — Source revision to absorb from
295
296 Default value: `@`
297 * `-t`, `--into <REVSETS>` [alias: `to`] — Destination revisions to absorb into
298
299 Only ancestors of the source revision will be considered.
300
301 Default value: `mutable()`
302 * `-i`, `--interactive` — Interactively choose which parts to absorb
303 * `--tool <NAME>` — Specify diff editor to be used (implies --interactive)
304
305
306
307 ## `jj arrange`
308
309 Interactively arrange the commit graph
310
311 **Usage:** `jj arrange [REVSETS]...`
312
313 ###### **Arguments:**
314
315 * `<REVSETS>` — The revisions to arrange [aliases: -r]
316
317 If no revisions are specified, this defaults to the `revsets.arrange` setting.
318
319
320
321 ## `jj bisect`
322
323 Find a bad revision by bisection
324
325 **Usage:** `jj bisect <COMMAND>`
326
327 ###### **Subcommands:**
328
329 * `run` — Run a given command to find the first bad revision
330
331
332
333 ## `jj bisect run`
334
335 Run a given command to find the first bad revision
336
337 Uses binary search to find the first "bad" revision. Revisions are evaluated
338 by running the given command (see the documentation for `<COMMAND>` for
339 details).
340
341 It is assumed that if a given revision is "bad", then all its descendants
342 in the input range are also "bad".
343
344 The target of the bisection can be inverted to look for the first "good"
345 revision by passing `--find-good`.
346
347 Hint: You can pass your shell as the command, then run manual tests in a
348 script. When you're done, make sure to exit the shell with an appropriate
349 error code depending on the desired outcome (e.g., `exit 0` to mark the
350 revision as "good").
351
352 Example: To run `cargo test` with the changes from revision `xyz` applied:
353 ```shell
354 jj bisect run --range v1.0..main -- bash -c "jj duplicate xyz -B @ &&
355 cargo test"
356 ```
357
358 **Usage:** `jj bisect run [OPTIONS] --range <REVSETS> [COMMAND] [ARGS]...`
359
360 ###### **Arguments:**
361
362 * `<COMMAND>` — Command to run to determine the status of a revision
363
364 Each revision being checked will be directly edited (will become the current working copy) before running this command. The exit status of the command will be used to mark revisions as "good" or "bad": status 0 means "good", 125 means to skip the revision, 127 (command not found) will abort the bisection, and any other non-zero exit status means the revision is "bad".
365
366 The target's commit ID is available to the command in the `$JJ_BISECT_TARGET` environment variable.
367 * `<ARGS>` — Arguments to pass to the command
368
369 Hint: Use a `--` separator to allow passing arguments starting with `-`. For example: `jj bisect run --range=... -- test -f some-file`.
370
371 ###### **Options:**
372
373 * `-r`, `--range <REVSETS>` — Range of revisions to bisect (can be repeated)
374
375 This is typically a range like `v1.0..main`. The heads of the range are assumed to be bad. Ancestors of the range that are not also in the range are assumed to be good.
376
377 The union of all given ranges are used as the input for the bisection.
378 * `--find-good` — Find the first good revision instead
379
380 The interpretation of exit statuses will be inverted (excluding special exit statuses), so status 0 means bad and other non-zero statuses mean good.
381
382 Default value: `false`
383
384
385
386 ## `jj bookmark`
387
388 Manage bookmarks [default alias: b]
389
390 See [`jj help -k bookmarks`] for more information.
391
392 [`jj help -k bookmarks`]: https://docs.jj-vcs.dev/latest/bookmarks
393
394 **Usage:** `jj bookmark <COMMAND>`
395
396 ###### **Subcommands:**
397
398 * `advance` — Advance the closest bookmarks to a target revision
399 * `create` — Create a new bookmark
400 * `delete` — Delete an existing bookmark and propagate the deletion to remotes on the next push
401 * `forget` — Forget a bookmark without marking it as a deletion to be pushed
402 * `list` — List bookmarks and their targets
403 * `move` — Move existing bookmarks to target revision
404 * `rename` — Rename `old` bookmark name to `new` bookmark name
405 * `set` — Create a new bookmark, or update an existing one by name
406 * `track` — Start tracking given remote bookmarks
407 * `untrack` — Stop tracking given remote bookmarks
408
409
410
411 ## `jj bookmark advance`
412
413 Advance the closest bookmarks to a target revision
414
415 The target `--to` defaults to `revsets.bookmark-advance-to` (which defaults to `@`).
416
417 The bookmarks to advance are determined by `revsets.bookmark-advance-from` (which defaults to `heads(::to & bookmarks())`).
418
419 Note that the from revset has access to `to`.
420
421 Positional bookmark name arguments can target specific bookmarks to advance to the target, in this case the default from revset is ignored.
422
423 Example:
424
425 `jj bookmark advance --to x` - Does the equivalent of `jj bookmark move --from 'heads(::x & bookmarks())' --to x`.
426
427 **Usage:** `jj bookmark advance [OPTIONS] [NAMES]...`
428
429 **Command Alias:** `a`
430
431 ###### **Arguments:**
432
433 * `<NAMES>` — Move bookmarks matching the given name patterns
434
435 By default, the specified pattern matches bookmark names with glob syntax. You can also use other [string pattern syntax].
436
437 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
438
439 ###### **Options:**
440
441 * `-t`, `--to <REVSET>` — Move bookmarks to this revision
442
443 Defaults to `revsets.bookmark-advance-to`.
444
445
446
447 ## `jj bookmark create`
448
449 Create a new bookmark
450
451 **Usage:** `jj bookmark create [OPTIONS] <NAMES>...`
452
453 **Command Alias:** `c`
454
455 ###### **Arguments:**
456
457 * `<NAMES>` — The bookmarks to create
458
459 ###### **Options:**
460
461 * `-r`, `--revision <REVSET>` [alias: `to`] — The bookmark's target revision
462
463 Default value: `@`
464
465
466
467 ## `jj bookmark delete`
468
469 Delete an existing bookmark and propagate the deletion to remotes on the next push
470
471 Revisions referred to by the deleted bookmarks are not abandoned. To delete revisions as well as bookmarks, use `jj abandon`. For example, `jj abandon main..<bookmark>` will abandon revisions belonging to the `<bookmark>` branch (relative to the `main` branch.)
472
473 If you don't want the deletion of the local bookmark to propagate to any tracked remote bookmarks, use `jj bookmark forget` instead.
474
475 **Usage:** `jj bookmark delete <NAMES>...`
476
477 **Command Alias:** `d`
478
479 ###### **Arguments:**
480
481 * `<NAMES>` — The bookmarks to delete
482
483 By default, the specified pattern matches bookmark names with glob syntax. You can also use other [string pattern syntax].
484
485 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
486
487
488
489 ## `jj bookmark forget`
490
491 Forget a bookmark without marking it as a deletion to be pushed
492
493 If a local bookmark is forgotten, any corresponding remote bookmarks will become untracked to ensure that the forgotten bookmark will not impact remotes on future pushes.
494
495 **Usage:** `jj bookmark forget [OPTIONS] <NAMES>...`
496
497 **Command Alias:** `f`
498
499 ###### **Arguments:**
500
501 * `<NAMES>` — The bookmarks to forget
502
503 By default, the specified pattern matches bookmark names with glob syntax. You can also use other [string pattern syntax].
504
505 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
506
507 ###### **Options:**
508
509 * `--include-remotes` — When forgetting a local bookmark, also forget any corresponding remote bookmarks
510
511 A forgotten remote bookmark will not impact remotes on future pushes. It will be recreated on future fetches if it still exists on the remote. If there is a corresponding Git-tracking remote bookmark, it will also be forgotten.
512
513
514
515 ## `jj bookmark list`
516
517 List bookmarks and their targets
518
519 By default, a tracked remote bookmark will be included only if its target is different from the local target. An untracked remote bookmark won't be listed. For a conflicted bookmark (both local and remote), old target revisions are preceded by a "-" and new target revisions are preceded by a "+".
520
521 See [`jj help -k bookmarks`] for more information.
522
523 [`jj help -k bookmarks`]: https://docs.jj-vcs.dev/latest/bookmarks
524
525 **Usage:** `jj bookmark list [OPTIONS] [NAMES]...`
526
527 **Command Alias:** `l`
528
529 ###### **Arguments:**
530
531 * `<NAMES>` — Show bookmarks whose local name matches
532
533 By default, the specified pattern matches bookmark names with glob syntax. You can also use other [string pattern syntax].
534
535 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
536
537 ###### **Options:**
538
539 * `-a`, `--all-remotes` — Show all tracked and untracked remote bookmarks including the ones whose targets are synchronized with the local bookmarks
540 * `--remote <REMOTE>` — Show all tracked and untracked remote bookmarks belonging to this remote
541
542 Can be combined with `--tracked` or `--conflicted` to filter the bookmarks shown (can be repeated.)
543
544 By default, the specified pattern matches remote names with glob syntax. You can also use other [string pattern syntax].
545
546 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
547 * `-t`, `--tracked` — Show tracked remote bookmarks only
548
549 This omits local Git-tracking bookmarks by default.
550 * `-c`, `--conflicted` — Show conflicted bookmarks only
551 * `-r`, `--revision <REVSETS>` — Show bookmarks whose local targets are in the given revisions
552
553 Note that `-r deleted_bookmark` will not work since `deleted_bookmark` wouldn't have a local target.
554 * `-T`, `--template <TEMPLATE>` — Render each bookmark using the given template
555
556 All 0-argument methods of the [`CommitRef` type] are available as keywords in the template expression. See [`jj help -k templates`] for more information.
557
558 The default template can be set by the `templates.bookmark_list` setting.
559
560 [`CommitRef` type]: https://docs.jj-vcs.dev/latest/templates/#commitref-type
561
562 [`jj help -k templates`]: https://docs.jj-vcs.dev/latest/templates/
563 * `--sort <SORT_KEY>` — Sort bookmarks based on the given key (or multiple keys)
564
565 Suffix the key with `-` to sort in descending order of the value (e.g. `--sort name-`). Note that when using multiple keys, the first key is the most significant.
566
567 This defaults to the `ui.bookmark-list-sort-keys` setting.
568
569 Possible values: `name`, `name-`, `author-name`, `author-name-`, `author-email`, `author-email-`, `author-date`, `author-date-`, `committer-name`, `committer-name-`, `committer-email`, `committer-email-`, `committer-date`, `committer-date-`
570
571
572
573
574 ## `jj bookmark move`
575
576 Move existing bookmarks to target revision
577
578 Unlike `jj bookmark set`, this command cannot create new bookmarks.
579
580 If bookmark names are given, the specified bookmarks will be updated to point to the target revision.
581
582 If `--from` options are given, bookmarks currently pointing to the specified revisions will be updated. The bookmarks can also be filtered by names.
583
584 **Usage:** `jj bookmark move [OPTIONS] <NAMES|--from <REVSETS>>`
585
586 **Command Alias:** `m`
587
588 ###### **Arguments:**
589
590 * `<NAMES>` — Move bookmarks matching the given name patterns
591
592 By default, the specified pattern matches bookmark names with glob syntax. You can also use other [string pattern syntax].
593
594 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
595
596 ###### **Options:**
597
598 * `-f`, `--from <REVSETS>` — Move bookmarks from the given revisions
599 * `-t`, `--to <REVSET>` — Move bookmarks to this revision
600
601 Default value: `@`
602 * `-B`, `--allow-backwards` — Allow moving bookmarks backwards or sideways
603
604
605
606 ## `jj bookmark rename`
607
608 Rename `old` bookmark name to `new` bookmark name
609
610 The new bookmark name points at the same commit as the old bookmark name.
611
612 **Usage:** `jj bookmark rename [OPTIONS] <OLD> <NEW>`
613
614 **Command Alias:** `r`
615
616 ###### **Arguments:**
617
618 * `<OLD>` — The old name of the bookmark
619 * `<NEW>` — The new name of the bookmark
620
621 ###### **Options:**
622
623 * `--overwrite-existing` — Allow renaming even if the new bookmark name already exists
624
625
626
627 ## `jj bookmark set`
628
629 Create a new bookmark, or update an existing one by name
630
631 If you want to move bookmarks based on their current location rather than by name, use `jj bookmark move --from <REVSETS>`.
632
633 **Usage:** `jj bookmark set [OPTIONS] <NAMES>...`
634
635 **Command Alias:** `s`
636
637 ###### **Arguments:**
638
639 * `<NAMES>` — The bookmarks to update
640
641 ###### **Options:**
642
643 * `-r`, `--revision <REVSET>` [alias: `to`] — The bookmark's target revision
644
645 Default value: `@`
646 * `-B`, `--allow-backwards` — Allow moving the bookmark backwards or sideways
647
648
649
650 ## `jj bookmark track`
651
652 Start tracking given remote bookmarks
653
654 A tracked remote bookmark will be imported as a local bookmark of the same name. Changes to it will propagate to the existing local bookmark on future pulls.
655
656 **Usage:** `jj bookmark track [OPTIONS] <BOOKMARK[@REMOTE]>...`
657
658 **Command Alias:** `t`
659
660 ###### **Arguments:**
661
662 * `<BOOKMARK[@REMOTE]>` — Bookmark name patterns or remote bookmark symbols to track
663
664 `BOOKMARK` matches bookmark names using glob syntax by default. You can also use other [string pattern syntax].
665
666 `BOOKMARK@REMOTE` resolves to a remote bookmark exactly.
667
668 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
669
670 ###### **Options:**
671
672 * `--remote <REMOTE>` — Remote names to track
673
674 By default, the specified pattern matches remote names with glob syntax. You can also use other [string pattern syntax].
675
676 If no remote names are given, all remote bookmarks matching the bookmark names will be tracked.
677
678 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
679
680
681
682 ## `jj bookmark untrack`
683
684 Stop tracking given remote bookmarks
685
686 An untracked remote bookmark is just a pointer to the last-fetched remote bookmark. It won't be imported as a local bookmark on future pulls.
687
688 If you want to forget a local bookmark while also untracking the corresponding remote bookmarks, use `jj bookmark forget` instead.
689
690 **Usage:** `jj bookmark untrack [OPTIONS] <BOOKMARK[@REMOTE]>...`
691
692 ###### **Arguments:**
693
694 * `<BOOKMARK[@REMOTE]>` — Bookmark name patterns or remote bookmark symbols to untrack
695
696 `BOOKMARK` matches bookmark names using glob syntax by default. You can also use other [string pattern syntax].
697
698 `BOOKMARK@REMOTE` resolves to a remote bookmark exactly.
699
700 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
701
702 ###### **Options:**
703
704 * `--remote <REMOTE>` — Remote names to untrack
705
706 By default, the specified pattern matches remote names with glob syntax. You can also use other [string pattern syntax].
707
708 If no remote names are given, all remote bookmarks matching the bookmark names will be untracked.
709
710 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
711
712
713
714 ## `jj commit`
715
716 Update the description and create a new change on top [default alias: ci]
717
718 When called without path arguments or `--interactive`, `jj commit` is equivalent to `jj describe` followed by `jj new`.
719
720 When using `--interactive` or path arguments, the selected changes stay in the current commit while the remaining changes are moved to a new working-copy commit on top. This is very similar to `jj split`. Differences include:
721
722 * `jj commit` is not interactive by default (it selects all changes).
723
724 * `jj commit` doesn't have a `-r` option. It always acts on the working-copy commit (@).
725
726 * `jj split` (without `-o`/`-A`/`-B`) will move bookmarks forward from the old change to the child change. `jj commit` doesn't move bookmarks forward.
727
728 * `jj split` allows you to move the selected changes to a different destination with `-o`/`-A`/`-B`.
729
730 **Usage:** `jj commit [OPTIONS] [FILESETS]...`
731
732 ###### **Arguments:**
733
734 * `<FILESETS>` — Put these paths in the current commit
735
736 ###### **Options:**
737
738 * `-i`, `--interactive` — Interactively choose which changes to include in the current commit
739 * `--tool <NAME>` — Specify diff editor to be used (implies --interactive)
740 * `-m`, `--message <MESSAGE>` — The change description to use (don't open editor)
741 * `--editor` — Open an editor to edit the change description
742
743 Forces an editor to open when using `--message` to allow the message to be edited afterwards.
744
745
746
747 ## `jj config`
748
749 Manage config options
750
751 Operates on jj configuration, which comes from the config file and environment variables.
752
753 See [`jj help -k config`] to know more about file locations, supported config options, and other details about `jj config`.
754
755 [`jj help -k config`]: https://docs.jj-vcs.dev/latest/config/
756
757 **Usage:** `jj config <COMMAND>`
758
759 ###### **Subcommands:**
760
761 * `edit` — Start an editor on a jj config file
762 * `gc` — Find and optionally delete repo-level config directories whose repo path no longer exists
763 * `get` — Get the value of a given config option.
764 * `list` — List variables set in config files, along with their values
765 * `path` — Print the paths to the config files
766 * `set` — Update a config file to set the given option to a given value
767 * `unset` — Update a config file to unset the given option
768
769
770
771 ## `jj config edit`
772
773 Start an editor on a jj config file.
774
775 Creates the file if it doesn't already exist regardless of what the editor does.
776
777 **Usage:** `jj config edit <--user|--repo|--workspace|--file <PATH>>`
778
779 **Command Alias:** `e`
780
781 ###### **Options:**
782
783 * `--user` — Target the user-level config
784 * `--repo` — Target the repo-level config
785 * `--workspace` — Target the workspace-level config
786 * `--file <PATH>` — Target the config file specified by the given path
787
788 The path must point to a valid configuration file location recognized by Jujutsu (such as a user/repo/workspace config, a file inside a `conf.d/` directory, or any file loaded via system configs, `$JJ_CONFIG`, or `--config-file`).
789
790 Unlike the global `--config-file` option (which loads an extra config file when running commands), this option specifies which file to inspect, edit, or modify on disk.
791
792 If the file does not exist, commands like `set` and `edit` will create it and any missing parent directories.
793
794
795
796 ## `jj config gc`
797
798 Find and optionally delete repo-level config directories whose repo path no longer exists
799
800 **Usage:** `jj config gc`
801
802
803
804 ## `jj config get`
805
806 Get the value of a given config option.
807
808 Unlike `jj config list`, the result of `jj config get` is printed without
809 extra formatting and therefore is usable in scripting. For example:
810
811 $ jj config list user.name
812 user.name="Martin von Zweigbergk"
813 $ jj config get user.name
814 Martin von Zweigbergk
815
816 **Usage:** `jj config get <NAME>`
817
818 **Command Alias:** `g`
819
820 ###### **Arguments:**
821
822 * `<NAME>`
823
824
825
826 ## `jj config list`
827
828 List variables set in config files, along with their values
829
830 **Usage:** `jj config list [OPTIONS] [NAME]`
831
832 **Command Alias:** `l`
833
834 ###### **Arguments:**
835
836 * `<NAME>` — An optional name of a specific config option to look up
837
838 ###### **Options:**
839
840 * `--include-defaults` — Whether to explicitly include built-in default values in the list
841 * `--include-overridden` — Allow printing overridden values
842 * `--user` — Target the user-level config
843 * `--repo` — Target the repo-level config
844 * `--workspace` — Target the workspace-level config
845 * `-T`, `--template <TEMPLATE>` — Render each variable using the given template
846
847 The following keywords are available in the template expression:
848
849 * `name: String`: Config name, in [TOML's "dotted key" format].
850 * `value: ConfigValue`: Value to be formatted in TOML syntax.
851 * `overridden: Boolean`: True if the value is shadowed by other.
852 * `source: String`: Source of the value.
853 * `path: Option<FsPath>`: Path to the config file.
854
855 Can be overridden by the `templates.config_list` setting. To
856 see a detailed config list, use the `builtin_config_list_detailed`
857 template.
858
859 See [`jj help -k templates`] for more information.
860
861 [TOML's "dotted key" format]: https://toml.io/en/v1.0.0#keys
862
863 [`jj help -k templates`]:
864 https://docs.jj-vcs.dev/latest/templates/
865
866
867
868 ## `jj config path`
869
870 Print the paths to the config files
871
872 A config file at that path may or may not exist.
873
874 If `--repo` or `--workspace` is specified and the config file does not exist, jj will generate a new config directory for this repo/workspace and print the path to the config file in that directory.
875
876 See `jj config edit` if you'd like to immediately edit a file.
877
878 **Usage:** `jj config path <--user|--repo|--workspace>`
879
880 **Command Alias:** `p`
881
882 ###### **Options:**
883
884 * `--user` — Target the user-level config
885 * `--repo` — Target the repo-level config
886 * `--workspace` — Target the workspace-level config
887
888
889
890 ## `jj config set`
891
892 Update a config file to set the given option to a given value
893
894 **Usage:** `jj config set <--user|--repo|--workspace|--file <PATH>> <NAME> <VALUE>`
895
896 **Command Alias:** `s`
897
898 ###### **Arguments:**
899
900 * `<NAME>`
901 * `<VALUE>` — New value to set
902
903 The value should be specified as a TOML expression. If string value isn't enclosed by any TOML constructs (such as apostrophes or array notation), quotes can be omitted. Note that the value may also need shell quoting. TOML multi-line strings can be useful if the value contains apostrophes. For example, to set `foo.bar` to the string "{don't}" use `jj config set --user foo.bar "'''{don't}'''"`. This is valid in both Bash and Fish.
904
905 Alternative, e.g. to avoid dealing with shell quoting, use `jj config edit` to edit the TOML file directly.
906
907 ###### **Options:**
908
909 * `--user` — Target the user-level config
910 * `--repo` — Target the repo-level config
911 * `--workspace` — Target the workspace-level config
912 * `--file <PATH>` — Target the config file specified by the given path
913
914 The path must point to a valid configuration file location recognized by Jujutsu (such as a user/repo/workspace config, a file inside a `conf.d/` directory, or any file loaded via system configs, `$JJ_CONFIG`, or `--config-file`).
915
916 Unlike the global `--config-file` option (which loads an extra config file when running commands), this option specifies which file to inspect, edit, or modify on disk.
917
918 If the file does not exist, commands like `set` and `edit` will create it and any missing parent directories.
919
920
921
922 ## `jj config unset`
923
924 Update a config file to unset the given option
925
926 **Usage:** `jj config unset <--user|--repo|--workspace|--file <PATH>> <NAME>`
927
928 **Command Alias:** `u`
929
930 ###### **Arguments:**
931
932 * `<NAME>`
933
934 ###### **Options:**
935
936 * `--user` — Target the user-level config
937 * `--repo` — Target the repo-level config
938 * `--workspace` — Target the workspace-level config
939 * `--file <PATH>` — Target the config file specified by the given path
940
941 The path must point to a valid configuration file location recognized by Jujutsu (such as a user/repo/workspace config, a file inside a `conf.d/` directory, or any file loaded via system configs, `$JJ_CONFIG`, or `--config-file`).
942
943 Unlike the global `--config-file` option (which loads an extra config file when running commands), this option specifies which file to inspect, edit, or modify on disk.
944
945 If the file does not exist, commands like `set` and `edit` will create it and any missing parent directories.
946
947
948
949 ## `jj converge`
950
951 Converge divergent changes
952
953 Attempts to resolve divergence by replacing two or more visible revisions for a given change with a single revision. `jj converge` evaluates the revset(s) given by the `--revisions` arg (or the `revsets.converge` setting if none are specified) and groups the resulting revisions by change ID. Change IDs with more than one revision are divergent.
954
955 If there is no divergence it returns successfully. If there is more than one divergent change it prompts the user to choose one. The command then applies heuristics to try to automatically come up with a good solution (i.e. a new revision) that replaces the divergent revisions. If the heuristics are inconclusive `jj converge` falls back to prompting the user. Use `--no-interactive` to print a warning instead of prompting the user.
956
957 The user may be prompted for any of the following: to merge revision descriptions, to choose parents for the solution, and/or (very rarely) to choose a revision author.
958
959 When a solution is found, the new revision replaces the divergent revisions of the specific change ID (but only those matching the revsets; if there are other visible revisions for the same change ID outside the revset, those will remain and you will still have divergence, though it will be reduced). Descendants of the divergent revisions are rebased onto the solution, and local bookmarks pointing to any divergent revision are updated to point to the solution.
960
961 Note that there may be file conflicts in the solution whether or not there were conflicts to begin with.
962
963 The modifications made by `jj converge` can be reviewed by `jj op show -p`. You can inspect the change evolution with `jj evolog`. If not satisfied with the result you can run `jj undo`.
964
965 **Usage:** `jj converge [OPTIONS]`
966
967 ###### **Options:**
968
969 * `-r`, `--revision <REVSETS>` — The search space to look for divergent revisions
970
971 If no revisions are specified, this defaults to the `revsets.converge` setting.
972 * `--no-interactive` — Do not prompt the user for help resolving divergence
973
974 If the command cannot solve divergence automatically it will print a warning and exit without making any changes (divergence will still be present).
975
976
977
978 ## `jj describe`
979
980 Update the change description or other metadata [default alias: desc]
981
982 Starts an editor to let you edit the description of changes. Set `ui.editor` to customize your editor. See `jj help -k config` or the [editor docs] for more information on how the editor is chosen.
983
984 [editor docs]: https://docs.jj-vcs.dev/latest/config/#editor
985
986 **Usage:** `jj describe [OPTIONS] [REVSETS]...`
987
988 ###### **Arguments:**
989
990 * `<REVSETS>` — The revision(s) whose description to edit (default: @) [aliases: -r]
991
992 ###### **Options:**
993
994 * `-m`, `--message <MESSAGE>` — The change description to use (don't open editor)
995
996 If multiple revisions are specified, the same description will be used for all of them.
997 * `--stdin` — Read the change description from stdin
998
999 If multiple revisions are specified, the same description will be used for all of them.
1000 * `--editor` — Open an editor to edit the change description
1001
1002 Forces an editor to open when using `--stdin` or `--message` to allow the message to be edited afterwards.
1003
1004
1005
1006 ## `jj diff`
1007
1008 Compare file contents between two revisions
1009
1010 With the `-r` option, shows the changes compared to the parent revision. If there are several parent revisions (i.e., the given revision is a merge), then they will be merged and the changes from the result to the given revision will be shown.
1011
1012 With the `--from` and/or `--to` options, shows the difference from/to the given revisions. If either is left out, it defaults to the working-copy commit. For example, `jj diff --from main` shows the changes from "main" (perhaps a bookmark name) to the working-copy commit.
1013
1014 If no option is specified, it defaults to `-r @`.
1015
1016 **Usage:** `jj diff [OPTIONS] [FILESETS]...`
1017
1018 ###### **Arguments:**
1019
1020 * `<FILESETS>` — Restrict the diff to these paths
1021
1022 ###### **Options:**
1023
1024 * `-r`, `--revisions <REVSETS>` — Show changes in these revisions
1025
1026 If there are multiple revisions, then the total diff for all of them will be shown. For example, if you have a linear chain of revisions A..D, then `jj diff -r B::D` equals `jj diff --from A --to D`. Multiple heads and/or roots are supported, but gaps in the revset are not supported (e.g. `jj diff -r 'A|C'` in a linear chain A..C).
1027
1028 If a revision is a merge commit, this shows changes *from* the automatic merge of the contents of all of its parents *to* the contents of the revision itself.
1029
1030 If none of `-r`, `-f`, or `-t` is provided, then the default is `-r @`.
1031 * `-f`, `--from <REVSET>` — Show changes from this revision
1032
1033 If none of `-r`, `-f`, or `-t` is provided, then the default is `-r @`.
1034 * `-t`, `--to <REVSET>` — Show changes to this revision
1035
1036 If none of `-r`, `-f`, or `-t` is provided, then the default is `-r @`.
1037 * `-T`, `--template <TEMPLATE>` — Render each file diff entry using the given template
1038
1039 All 0-argument methods of the [`TreeDiffEntry` type] are available as keywords in the template expression. See [`jj help -k templates`] for more information.
1040
1041 [`TreeDiffEntry` type]: https://docs.jj-vcs.dev/latest/templates/#treediffentry-type
1042
1043 [`jj help -k templates`]: https://docs.jj-vcs.dev/latest/templates/
1044 * `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
1045 * `--stat` — Show a histogram of the changes
1046 * `--types` — For each path, show only its type before and after
1047
1048 The diff is shown as two letters. The first letter indicates the type before and the second letter indicates the type after. '-' indicates that the path was not present, 'F' represents a regular file, `L' represents a symlink, 'C' represents a conflict, and 'G' represents a Git submodule.
1049 * `--name-only` — For each path, show only its path
1050
1051 Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g`
1052 * `--git` — Show a Git-format diff
1053 * `--color-words` — Show a word-level diff with changes indicated only by color
1054 * `--tool <TOOL>` — Generate diff by external command
1055
1056 A builtin format can also be specified as `:<name>`. For example, `--tool=:git` is equivalent to `--git`.
1057 * `--context <CONTEXT>` — Number of lines of context to show
1058 * `-w`, `--ignore-all-space` — Ignore whitespace when comparing lines
1059 * `-b`, `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines
1060
1061
1062
1063 ## `jj diffedit`
1064
1065 Touch up the content changes in a revision with a diff editor
1066
1067 With the `-r` option, starts a [diff editor] on the changes in the revision.
1068
1069 With the `--from` and/or `--to` options, starts a [diff editor] comparing the "from" revision to the "to" revision.
1070
1071 [diff editor]: https://docs.jj-vcs.dev/latest/config/#editing-diffs
1072
1073 Edit the right side of the diff until it looks the way you want. Once you close the editor, the revision specified with `-r` or `--to` will be updated. Unless `--restore-descendants` is used, descendants will be rebased on top as usual, which may result in conflicts.
1074
1075 See `jj restore` if you want to move entire files from one revision to another. For moving changes between revisions, see `jj squash -i`.
1076
1077 **Usage:** `jj diffedit [OPTIONS] [FILESETS]...`
1078
1079 ###### **Arguments:**
1080
1081 * `<FILESETS>` — Edit only these paths (unmatched paths will remain unchanged)
1082
1083 ###### **Options:**
1084
1085 * `-r`, `--revision <REVSET>` — The revision to touch up
1086
1087 Defaults to @ if neither --to nor --from are specified.
1088 * `-f`, `--from <REVSET>` — Show changes from this revision
1089
1090 Defaults to @ if --to is specified.
1091 * `-t`, `--to <REVSET>` — Edit changes in this revision
1092
1093 Defaults to @ if --from is specified.
1094 * `--tool <NAME>` — Specify diff editor to be used
1095 * `--restore-descendants` — Preserve the content (not the diff) when rebasing descendants
1096
1097 When rebasing a descendant on top of the rewritten revision, its diff compared to its parent(s) is normally preserved, i.e. the same way that descendants are always rebased. This flag makes it so the content/state is preserved instead of preserving the diff.
1098
1099
1100
1101 ## `jj duplicate`
1102
1103 Create new changes with the same content as existing ones
1104
1105 When none of the `--onto`, `--insert-after`, or `--insert-before` arguments are provided, commits will be duplicated onto their existing parents or onto other newly duplicated commits.
1106
1107 When any of the `--onto`, `--insert-after`, or `--insert-before` arguments are provided, the roots of the specified commits will be duplicated onto the destination indicated by the arguments. Other specified commits will be duplicated onto these newly duplicated commits. If the `--insert-after` or `--insert-before` arguments are provided, the new children indicated by the arguments will be rebased onto the heads of the specified commits.
1108
1109 By default, the duplicated commits retain the descriptions of the originals. This can be customized with the `templates.duplicate_description` setting.
1110
1111 **Usage:** `jj duplicate [OPTIONS] [REVSETS]...`
1112
1113 ###### **Arguments:**
1114
1115 * `<REVSETS>` — The revision(s) to duplicate (default: @) [aliases: -r]
1116
1117 ###### **Options:**
1118
1119 * `-o`, `--onto <REVSETS>` [alias: `destination`] — The revision(s) to duplicate onto (can be repeated to create a merge commit)
1120 * `-A`, `--insert-after <REVSETS>` [alias: `after`] — The revision(s) to insert after (can be repeated to create a merge commit)
1121 * `-B`, `--insert-before <REVSETS>` [alias: `before`] — The revision(s) to insert before (can be repeated to create a merge commit)
1122
1123
1124
1125 ## `jj edit`
1126
1127 Sets the specified revision as the working-copy revision
1128
1129 Note: it is [generally recommended] to instead use `jj new` and `jj squash`.
1130
1131 [generally recommended]: https://docs.jj-vcs.dev/latest/FAQ#how-do-i-resume-working-on-an-existing-change
1132
1133 **Usage:** `jj edit <REVSET|-r <REVSET>>`
1134
1135 ###### **Arguments:**
1136
1137 * `<REVSET>` — The commit to edit [aliases: -r]
1138
1139
1140
1141 ## `jj evolog`
1142
1143 Show how a change has evolved over time
1144
1145 Lists the previous commits which a change has pointed to. The current commit of a change evolves when the change is updated, rebased, etc.
1146
1147 **Usage:** `jj evolog [OPTIONS]`
1148
1149 **Command Alias:** `evolution-log`
1150
1151 ###### **Options:**
1152
1153 * `-r`, `--revisions <REVSETS>` — Follow changes from these revisions
1154
1155 Default value: `@`
1156 * `-n`, `--limit <LIMIT>` — Limit number of revisions to show
1157
1158 Applied after revisions are reordered topologically, but before being reversed.
1159 * `--reversed` — Show revisions in the opposite order (older revisions first)
1160 * `-G`, `--no-graph` — Show a flat list of revisions instead of a graph
1161 * `-T`, `--template <TEMPLATE>` — Render each revision using the given template
1162
1163 All 0-argument methods of the [`CommitEvolutionEntry` type] are available as keywords in the template expression. See [`jj help -k templates`] for more information.
1164
1165 If not specified, this defaults to the `templates.evolog` setting.
1166
1167 [`CommitEvolutionEntry` type]: https://docs.jj-vcs.dev/latest/templates/#commitevolutionentry-type
1168
1169 [`jj help -k templates`]: https://docs.jj-vcs.dev/latest/templates/
1170 * `-p`, `--patch` — Show patch compared to the previous version of this change
1171
1172 If the previous version has different parents, it will be temporarily rebased to the parents of the new version, so the diff is not contaminated by unrelated changes.
1173 * `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
1174 * `--stat` — Show a histogram of the changes
1175 * `--types` — For each path, show only its type before and after
1176
1177 The diff is shown as two letters. The first letter indicates the type before and the second letter indicates the type after. '-' indicates that the path was not present, 'F' represents a regular file, `L' represents a symlink, 'C' represents a conflict, and 'G' represents a Git submodule.
1178 * `--name-only` — For each path, show only its path
1179
1180 Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g`
1181 * `--git` — Show a Git-format diff
1182 * `--color-words` — Show a word-level diff with changes indicated only by color
1183 * `--tool <TOOL>` — Generate diff by external command
1184
1185 A builtin format can also be specified as `:<name>`. For example, `--tool=:git` is equivalent to `--git`.
1186 * `--context <CONTEXT>` — Number of lines of context to show
1187 * `--ignore-all-space` — Ignore whitespace when comparing lines
1188 * `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines
1189
1190
1191
1192 ## `jj file`
1193
1194 File operations
1195
1196 **Usage:** `jj file <COMMAND>`
1197
1198 ###### **Subcommands:**
1199
1200 * `annotate` — Show the source change for each line of the target file
1201 * `chmod` — Sets or removes the executable bit for paths in the repo
1202 * `list` — List files in a revision
1203 * `search` — Search for content in files
1204 * `show` — Print contents of files in a revision
1205 * `track` — Start tracking specified paths in the working copy
1206 * `untrack` — Stop tracking specified paths in the working copy
1207
1208
1209
1210 ## `jj file annotate`
1211
1212 Show the source change for each line of the target file.
1213
1214 Annotates a revision line by line. Each line includes the source change that introduced the associated line. A path to the desired file must be provided.
1215
1216 **Usage:** `jj file annotate [OPTIONS] <PATH>`
1217
1218 ###### **Arguments:**
1219
1220 * `<PATH>` — the file to annotate
1221
1222 ###### **Options:**
1223
1224 * `-r`, `--revision <REVSET>` — an optional revision to start at
1225 * `-T`, `--template <TEMPLATE>` — Render each line using the given template
1226
1227 All 0-argument methods of the [`AnnotationLine` type] are available as keywords in the template expression. See [`jj help -k templates`] for more information.
1228
1229 If not specified, this defaults to the `templates.file_annotate` setting.
1230
1231 [`AnnotationLine` type]: https://docs.jj-vcs.dev/latest/templates/#annotationline-type
1232
1233 [`jj help -k templates`]: https://docs.jj-vcs.dev/latest/templates/
1234
1235
1236
1237 ## `jj file chmod`
1238
1239 Sets or removes the executable bit for paths in the repo
1240
1241 Unlike the POSIX `chmod`, `jj file chmod` also works on Windows, on conflicted files, and on arbitrary revisions.
1242
1243 **Usage:** `jj file chmod [OPTIONS] <MODE> <FILESETS>...`
1244
1245 ###### **Arguments:**
1246
1247 * `<MODE>`
1248
1249 Possible values:
1250 - `n`:
1251 Make a path non-executable (alias: normal)
1252 - `x`:
1253 Make a path executable (alias: executable)
1254
1255 * `<FILESETS>` — Paths to change the executable bit for
1256
1257 ###### **Options:**
1258
1259 * `-r`, `--revision <REVSET>` — The revision to update
1260
1261 Default value: `@`
1262
1263
1264
1265 ## `jj file list`
1266
1267 List files in a revision
1268
1269 **Usage:** `jj file list [OPTIONS] [FILESETS]...`
1270
1271 ###### **Arguments:**
1272
1273 * `<FILESETS>` — Only list files matching these prefixes (instead of all files)
1274
1275 ###### **Options:**
1276
1277 * `-r`, `--revision <REVSET>` — The revision to list files in
1278
1279 Default value: `@`
1280 * `-T`, `--template <TEMPLATE>` — Render each file entry using the given template
1281
1282 All 0-argument methods of the [`TreeEntry` type] are available as keywords in the template expression. See [`jj help -k templates`] for more information.
1283
1284 The default template can be set by the `templates.file_list` setting.
1285
1286 [`TreeEntry` type]: https://docs.jj-vcs.dev/latest/templates/#treeentry-type
1287
1288 [`jj help -k templates`]: https://docs.jj-vcs.dev/latest/templates/
1289
1290
1291
1292 ## `jj file search`
1293
1294 Search for content in files
1295
1296 Prints each line that matches the specified pattern, prefixed by the file path. Use `--name-only` to print only the file paths.
1297
1298 This is an early version of the command. It does not search files concurrently.
1299
1300 **Usage:** `jj file search [OPTIONS] --pattern <PATTERN> [FILESETS]...`
1301
1302 ###### **Arguments:**
1303
1304 * `<FILESETS>` — Only search files matching these prefixes (instead of all files)
1305
1306 ###### **Options:**
1307
1308 * `-r`, `--revision <REVSET>` — The revision to search files in
1309
1310 Default value: `@`
1311 * `-p`, `--pattern <PATTERN>` — The pattern to search for in a single line
1312
1313 It is a [string pattern syntax] like `kind:pattern`. The kind defaults to regex when omitted.
1314
1315 If it is a glob pattern, the whole line must match the pattern, so you may want to pass something like `--pattern 'glob:*foo*'`.
1316
1317 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
1318 * `--name-only` — Print only the paths of files that contain a match, not the matched lines
1319 * `-n`, `--line-number` — Prefix each matched line with its 1-based line number within the file
1320
1321
1322
1323 ## `jj file show`
1324
1325 Print contents of files in a revision
1326
1327 If the given path is a directory, files in the directory will be visited recursively.
1328
1329 **Usage:** `jj file show [OPTIONS] <FILESETS>...`
1330
1331 ###### **Arguments:**
1332
1333 * `<FILESETS>` — Paths to print
1334
1335 ###### **Options:**
1336
1337 * `-r`, `--revision <REVSET>` — The revision to get the file contents from
1338
1339 Default value: `@`
1340 * `-T`, `--template <TEMPLATE>` — Render each file metadata using the given template
1341
1342 All 0-argument methods of the [`TreeEntry` type] are available as keywords in the template expression. See [`jj help -k templates`] for more information.
1343
1344 If not specified, this defaults to the `templates.file_show` setting.
1345
1346 [`TreeEntry` type]: https://docs.jj-vcs.dev/latest/templates/#treeentry-type
1347
1348 [`jj help -k templates`]: https://docs.jj-vcs.dev/latest/templates/
1349
1350
1351
1352 ## `jj file track`
1353
1354 Start tracking specified paths in the working copy
1355
1356 Without arguments, all paths that are not ignored will be tracked.
1357
1358 By default, new files in the working copy are automatically tracked, so this command has no effect. You can configure which paths to automatically track by setting `snapshot.auto-track` (e.g. to `"none()"` or `"glob:**/*.rs"`). Files that don't match the pattern can be manually tracked using this command. The default pattern is `all()`.
1359
1360 **Usage:** `jj file track [OPTIONS] <FILESETS>...`
1361
1362 ###### **Arguments:**
1363
1364 * `<FILESETS>` — Paths to track
1365
1366 ###### **Options:**
1367
1368 * `--include-ignored` — Track paths even if they're ignored or too large
1369
1370 By default, `jj file track` will not track files that are ignored by .gitignore or exceed the maximum file size. This flag overrides those restrictions, explicitly tracking the specified paths.
1371
1372
1373
1374 ## `jj file untrack`
1375
1376 Stop tracking specified paths in the working copy
1377
1378 **Usage:** `jj file untrack <FILESETS>...`
1379
1380 ###### **Arguments:**
1381
1382 * `<FILESETS>` — Paths to untrack. They must already be ignored.
1383
1384 The paths could be ignored via a .gitignore or .git/info/exclude (in colocated workspaces).
1385
1386
1387
1388 ## `jj fix`
1389
1390 Update files with formatting fixes or other changes
1391
1392 The primary use case for this command is to apply the results of automatic
1393 code formatting tools to revisions that may not be properly formatted yet.
1394 It can also be used to modify files with other tools like `sed` or `sort`.
1395
1396 The modification made by `jj fix` can be reviewed by `jj op show -p`.
1397
1398 ### How it works
1399
1400 The changed files in the given revisions will be updated with any fixes
1401 determined by passing their file content through any external tools the user
1402 has configured for those files. Descendants will also be updated by passing
1403 their versions of the same files through the same tools, which will ensure
1404 that the fixes are not lost. This will never result in new conflicts. Files
1405 with existing conflicts will be updated on all sides of the conflict, which
1406 can potentially increase or decrease the number of conflict markers.
1407
1408 ### Deduplication
1409
1410 When fixing multiple commits, if the same file content appears at the same
1411 path in different commits, the tool is run only once and the result is
1412 reused. This means that tools used with `jj fix` must produce deterministic
1413 output.
1414
1415 ### Configuration
1416
1417 See `jj help -k config` chapter `Code formatting and other file content
1418 transformations` to understand how to configure your tools.
1419
1420 ### Execution example
1421
1422 Let's consider the following configuration. We have two code formatters
1423 (`clang-format` and `black`), which apply to three different file extensions
1424 (`.cc`, `.h`, and `.py`):
1425
1426 ```toml
1427 [fix.tools.clang-format]
1428 command = ["/usr/bin/clang-format", "--assume-filename=$path"]
1429 patterns = ["glob:'**/*.cc'",
1430 "glob:'**/*.h'"]
1431
1432 [fix.tools.black]
1433 command = ["/usr/bin/black", "-", "--stdin-filename=$path"]
1434 patterns = ["glob:'**/*.py'"]
1435 ```
1436
1437 Now, let's see what would happen to the following history, when executing
1438 `jj fix`.
1439
1440 ```text
1441 C (mutable)
1442 | Modifies file: foo.py
1443 |
1444 B @ (working copy - mutable)
1445 | Modifies file: README.md
1446 |
1447 A (mutable)
1448 | Modifies files: src/bar.cc and src/bar.h
1449 |
1450 X (immutable)
1451 ```
1452
1453 By default, `jj fix` will modify revisions that match the revset
1454 `reachable(@, mutable())` (see `jj help -k revsets`), which corresponds to
1455 the revisions `A`, `B` and `C` here.
1456
1457 The following operations will then happen:
1458
1459 - For revision `A`, the contents from this revision for files `src/bar.cc`
1460 and `src/bar.h` will be provided to `clang-format`, and the resulting
1461 output will be used to recreate revision `A`, which we will call `A'`. All
1462 other files are untouched.
1463 - For revision `B`, the same thing happens for files `src/bar.cc` and
1464 `src/bar.h`. Their contents from revision `B` will go through
1465 `clang-format`. The file `README.md`, same as all other files, is
1466 untouched as no pattern matches it. We obtain revision `B'`.
1467 - For revision `C`, the files `src/bar.cc` and `src/bar.h` go through
1468 `clang-format` and the file `foo.py` is fixed using `black`. All other
1469 files are untouched. We obtain revision `C'`.
1470
1471 ```text
1472 C (mutable) /-> C'
1473 | src/bar.cc -> clang-format -| |
1474 | src/bar.h --> clang-format -| |
1475 | foo.py -----> black --------| |
1476 | * --------------------------/ |
1477 | |
1478 B @ (working copy - mutable) /-> B' @
1479 | src/bar.cc -> clang-format -| |
1480 | src/bar.h --> clang-format -| |
1481 | * --------------------------| |
1482 | |
1483 A (mutable) /-> A'
1484 | src/bar.cc -> clang-format -| |
1485 | src/bar.h --> clang-format -| |
1486 | * --------------------------/ |
1487 | |
1488 X (immutable) X
1489 ```
1490
1491 The revisions are now all correctly formatted according to the
1492 configuration.
1493
1494 **Usage:** `jj fix [OPTIONS] [FILESETS]...`
1495
1496 ###### **Arguments:**
1497
1498 * `<FILESETS>` — Fix only these paths
1499
1500 ###### **Options:**
1501
1502 * `-s`, `--source <REVSETS>` — Fix files in the specified revision(s) and their descendants. If no revisions are specified, this defaults to the `revsets.fix` setting, or `reachable(@, mutable())` if it is not set
1503 * `--include-unchanged-files` — Fix unchanged files in addition to changed ones. If no paths are specified, all files in the repo will be fixed
1504 * `-a`, `--all-lines` — Format all lines instead of only modified lines.
1505
1506 If the formatter doesn't support formatting only modified lines, then this option has no effect since the formatter always formats all lines.
1507
1508
1509
1510 ## `jj gerrit`
1511
1512 Interact with Gerrit Code Review
1513
1514 **Usage:** `jj gerrit <COMMAND>`
1515
1516 ###### **Subcommands:**
1517
1518 * `upload` — Upload changes to Gerrit for code review, or update existing changes
1519
1520
1521
1522 ## `jj gerrit upload`
1523
1524 Upload changes to Gerrit for code review, or update existing changes
1525
1526 Uploading a set of revisions to Gerrit creates a single "change" for each
1527 revision included in the revset and all their mutable ancestors. These
1528 changes will then be available for review on your Gerrit instance.
1529
1530 If a change already exists for a given revision (i.e. it contains the
1531 same `Change-Id`), this command will update the contents of the existing
1532 change to match.
1533
1534 Note: Any commit in the given revset that does not have a `Change-Id`
1535 trailer will have one generated based on the Jujutsu change ID. This trailer
1536 is only added to the uploaded commit, which means the resulting commit ID
1537 uploaded to Gerrit may not match your local commit ID. As a result, you may
1538 encounter divergence when you fetch a merged change into your local repo. To
1539 address this, you can abandon your local change or rebase it on top of trunk
1540 with `jj rebase --skip-emptied ...`, which will resolve the divergence.
1541 Alternatively, you can add the following to your Jujutsu config to add
1542 `Change-Id` trailers to your local commits automatically before `jj gerrit
1543 upload` does:
1544 ```toml
1545 [templates]
1546 commit_trailers = '''
1547 if(
1548 !trailers.contains_key("Change-Id"),
1549 format_gerrit_change_id_trailer(self)
1550 )
1551 '''
1552 ```
1553
1554 Also see the [Jujutsu docs on Gerrit].
1555
1556 [Jujutsu docs on Gerrit]: https://docs.jj-vcs.dev/latest/gerrit
1557
1558 **Usage:** `jj gerrit upload [OPTIONS]`
1559
1560 ###### **Options:**
1561
1562 * `-r`, `--revision <REVSETS>` — The revisions to upload to Gerrit
1563
1564 All mutable ancestors of specified revisions will also be pushed. This means that `jj gerrit upload -r foo` is equivalent to `jj gerrit upload -r 'mutable()::foo'`.
1565
1566 If this is not provided, `@` will be uploaded if it has a description, and `@-` will be uploaded otherwise.
1567 * `-b`, `--remote-branch <REMOTE_BRANCH>` — The location where your changes are intended to land
1568
1569 This should be a branch on the remote. The default is the `gerrit.default-remote-branch` setting.
1570 * `--remote <REMOTE>` — The Gerrit remote to push to
1571
1572 This can point to any configured Git remote, or can be a full SSH URL. The default is the `gerrit.default-remote` setting.
1573 * `-n`, `--dry-run` — Only display what will change on the remote; do not push changes to Gerrit
1574 * `--reviewer <REVIEWER>` — Add these emails as a reviewer (can be repeated)
1575 * `--cc <CC>` — CC these emails on the change (can be repeated)
1576 * `-l`, `--label <LABEL>` — Add the following labels configured by Gerrit (can be repeated)
1577
1578 Each label can have a suffix of the value to set, such as "+2". The
1579 default is "+1" if no value is set.
1580
1581 Note that Gerrit silently ignores labels not present on your Gerrit
1582 host.
1583
1584 Examples:
1585 - `--label=Commit-Queue` will set the `Commit-Queue` label to +1.
1586 - `--label=Commit-Queue+2` will set it to +2.
1587 * `--topic <TOPIC>` — Apply a topic to the change
1588
1589 Changes can be grouped by topic, and Gerrit can be configured to submit all changes in a topic together in a single click.
1590
1591 See https://gerrit-review.googlesource.com/Documentation/intro-user.html#topics.
1592 * `--hashtag <HASHTAG>` — Apply a hashtag to the change (can be repeated)
1593
1594 Hashtags are freeform strings associated with a change, like on social media platforms. Similar to topics, hashtags can be used to group related changes together, and to search using the `hashtag:` operator. Unlike topics, a change can have multiple hashtags, and they are only used for informational grouping. Changes with the same hashtags are not necessarily submitted together.
1595
1596 See https://gerrit-review.googlesource.com/Documentation/intro-user.html#hashtags.
1597 * `-m`, `--message <MESSAGE>` — The description for the patch set
1598 * `--edit` — Push the change as a change edit
1599
1600 To push a change edit the underlying change needs to already exist on the Gerrit server. Change edits don't immediately create a new patch set, but need to be published from the web UI first. There can only be one edit for each change. Pushing a new change edit will replace the previous one.
1601 * `--wip` — Mark the change as WIP (work in progress)
1602
1603 See https://gerrit-review.googlesource.com/Documentation/intro-user.html#wip.
1604 * `--ready` — Mark the change as ready (no longer work in progress)
1605 * `--private` — Mark the change as private
1606
1607 See https://gerrit-review.googlesource.com/Documentation/intro-user.html#private-changes.
1608 * `--remove-private` — Unmark the change as private
1609 * `--publish-comments` — Publish draft comments for the given change
1610 * `--no-publish-comments` — Do not publish draft comments for the given change
1611
1612 This is only useful if the user has configured Gerrit to publish comments by default.
1613 * `--notify <NOTIFY>` — Who to email notifications to (defaults to all)
1614
1615 Possible values:
1616 - `none`:
1617 No emails
1618 - `owner`:
1619 Only the change owner is notified
1620 - `owner-reviewers`:
1621 Only the change owner and reviewers will be notified
1622 - `all`:
1623 All relevant users, including owner, reviewers, cc'd, users that have starred the change, and users who have configured a watch on files in the change
1624
1625 * `--submit` — Directly submit the changes, bypassing code review
1626 * `--skip-validation` — When --submit is provided, skip performing validations
1627 * `--merged` — Create a new change, even if the change has already been merged
1628 * `--ignore-attention-set` — Do not modify the attention set upon uploading
1629 * `--deadline <DEADLINE>` — The deadline after which the push should be aborted
1630 * `--custom <CUSTOM>` — Send the following custom keyed values to Gerrit (can be repeated)
1631
1632 See https://gerrit-review.googlesource.com/Documentation/user-upload.html#custom_keyed_values
1633 * `-o`, `--option <OPTION>` — Send a `git push -o` option (can be repeated)
1634 * `--trace <TRACE>` — For debugging Gerrit
1635
1636 See https://gerrit-review.googlesource.com/Documentation/user-upload.html#trace
1637
1638
1639
1640 ## `jj git`
1641
1642 Commands for working with Git remotes and the underlying Git repo
1643
1644 See this [comparison], including a [table of commands].
1645
1646 [comparison]: https://docs.jj-vcs.dev/latest/git-comparison/.
1647
1648 [table of commands]: https://docs.jj-vcs.dev/latest/git-command-table
1649
1650 **Usage:** `jj git <COMMAND>`
1651
1652 ###### **Subcommands:**
1653
1654 * `clone` — Create a new repo backed by a clone of a Git repo
1655 * `colocation` — Manage Jujutsu repository colocation with Git
1656 * `export` — Update the underlying Git repo with changes made in the repo
1657 * `fetch` — Fetch from a Git remote
1658 * `import` — Update repo with changes made in the underlying Git repo
1659 * `init` — Create a new Git backed repo
1660 * `push` — Push to a Git remote
1661 * `remote` — Manage Git remotes
1662 * `root` — Show the underlying Git directory of a repository using the Git backend
1663
1664
1665
1666 ## `jj git clone`
1667
1668 Create a new repo backed by a clone of a Git repo
1669
1670 **Usage:** `jj git clone [OPTIONS] <SOURCE> [DESTINATION]`
1671
1672 ###### **Arguments:**
1673
1674 * `<SOURCE>` — URL or path of the Git repo to clone
1675
1676 Local path will be resolved to absolute form.
1677 * `<DESTINATION>` — Specifies the target directory for the Jujutsu repository clone. If not provided, defaults to a directory named after the last component of the source URL. The full directory path will be created if it doesn't exist
1678
1679 ###### **Options:**
1680
1681 * `--remote <REMOTE_NAME>` — Name of the newly created remote
1682
1683 Default value: `origin`
1684 * `--colocate` — Colocate the Jujutsu repo with the git repo
1685
1686 Specifies that the `jj` repo should also be a valid `git` repo, allowing the use of both `jj` and `git` commands in the same directory.
1687
1688 The repository will contain a `.git` dir in the top-level. Regular Git tools will be able to operate on the repo.
1689
1690 **This is the default**, and this option has no effect, unless the [git.colocate config] is set to `false`.
1691
1692 [git.colocate config]: https://docs.jj-vcs.dev/latest/config/#default-colocation
1693 * `--no-colocate` — Disable colocation of the Jujutsu repo with the git repo
1694
1695 Prevent Git tools that are unaware of `jj` and regular Git commands from operating on the repo. The Git repository that stores most of the repo data will be hidden inside a sub-directory of the `.jj` directory.
1696
1697 See [colocation docs] for some minor advantages of non-colocated workspaces.
1698
1699 [colocation docs]: https://docs.jj-vcs.dev/latest/git-compatibility/#colocated-jujutsugit-repos
1700 * `--depth <DEPTH>` — Create a shallow clone of the given depth
1701 * `-b`, `--branch <BRANCH>` — Name of the branch to fetch and use as the parent of the working-copy change (can be repeated)
1702
1703 If not present, all branches are fetched and the repository's default branch is used as parent of the working-copy change.
1704
1705 By default, the specified pattern matches branch names with glob syntax, but only `*` is expanded. Other wildcard characters such as `?` are *not* supported. Patterns can be repeated or combined with [logical operators] to specify multiple branches, but only union and negative intersection are supported. If there are multiple matching branches, the first exact branch name is used as the working-copy parent.
1706
1707 Examples: `push-*`, `(push-* | foo/*) ~ foo/unwanted`
1708
1709 [logical operators]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
1710 * `-t`, `--tag <TAG>` — Fetch only some of the tags (can be repeated)
1711
1712 By default, the specified pattern matches tag names with glob syntax, but only `*` is expanded. Other wildcard characters such as `?` are *not* supported. Patterns can be repeated or combined with [logical operators] to specify multiple tags, but only union and negative intersection are supported.
1713
1714 [logical operators]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
1715 * `--object-hash <OBJECT_HASH>` — Object hash algorithm for the local Git repository.
1716
1717 *Must* match the remote's hash algorithm, otherwise the operation will fail. Most existing repositories today still use the classic SHA-1 format, which is also the default if not configured otherwise by the [git.object-hash config].
1718
1719 See also Git's [hash-function-transition] document for an in-depth explanation of the migration towards stronger hash functions.
1720
1721 [git.object-hash config]: https://docs.jj-vcs.dev/latest/config/#default-object-hash-format [hash-function-transition]: https://git-scm.com/docs/hash-function-transition
1722
1723 Possible values: `sha1`, `sha256`
1724
1725
1726
1727
1728 ## `jj git colocation`
1729
1730 Manage Jujutsu repository colocation with Git
1731
1732 **Usage:** `jj git colocation <COMMAND>`
1733
1734 ###### **Subcommands:**
1735
1736 * `disable` — Convert into a non-colocated Jujutsu/Git repository
1737 * `enable` — Convert into a colocated Jujutsu/Git repository
1738 * `status` — Show the current colocation status
1739
1740
1741
1742 ## `jj git colocation disable`
1743
1744 Convert into a non-colocated Jujutsu/Git repository
1745
1746 This moves the Git repository that is at the root of the Jujutsu workspace into the .jj directory. Once this is done you will no longer be able to use Git commands directly in the Jujutsu workspace.
1747
1748 **Usage:** `jj git colocation disable`
1749
1750
1751
1752 ## `jj git colocation enable`
1753
1754 Convert into a colocated Jujutsu/Git repository
1755
1756 This moves the underlying Git repository that is found inside the .jj directory to the root of the Jujutsu workspace. This allows you to use Git commands directly in the Jujutsu workspace.
1757
1758 **Usage:** `jj git colocation enable`
1759
1760
1761
1762 ## `jj git colocation status`
1763
1764 Show the current colocation status
1765
1766 **Usage:** `jj git colocation status`
1767
1768
1769
1770 ## `jj git export`
1771
1772 Update the underlying Git repo with changes made in the repo
1773
1774 By default, this command does nothing in colocated workspaces because the export happens automatically. Use `--ignore-working-copy` to forcibly export changes.
1775
1776 **Usage:** `jj git export`
1777
1778
1779
1780 ## `jj git fetch`
1781
1782 Fetch from a Git remote
1783
1784 If no remotes are specified, fetches the remotes specified by the `git.fetch` setting. If that is not configured and there are multiple remotes, the remote named "origin" will be used.
1785
1786 If no branches nor tags are specified, fetches bookmarks and tags specified by the `remotes.<name>.fetch-bookmarks`/`fetch-tags` settings. If `remotes.<name>.fetch-bookmarks` is not configured, the default fetch refspecs for the selected remotes are read from the Git configuration.
1787
1788 Commits that are no longer reachable from any branch on the remote will be considered abandoned by the remote, and will be abandoned in the local repo to match the remote. Set `git.abandon-unreachable-commits` to `false` to disable this behavior.
1789
1790 If a working-copy commit gets abandoned, it will be given a new, empty commit. This is true in general; it is not specific to this command.
1791
1792 **Usage:** `jj git fetch [OPTIONS]`
1793
1794 ###### **Options:**
1795
1796 * `-b`, `--branch <BRANCH>` — Name of the branch to fetch (can be repeated)
1797
1798 By default, the specified pattern matches branch names with glob syntax, but only `*` is expanded. Other wildcard characters such as `?` are *not* supported. Patterns can be repeated or combined with [logical operators] to specify multiple branches, but only union and negative intersection are supported.
1799
1800 Examples: `push-*`, `(push-* | foo/*) ~ foo/unwanted`
1801
1802 [logical operators]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
1803 * `-t`, `--tag <TAG>` — Fetch only some of the tags (can be repeated)
1804
1805 By default, the specified pattern matches tag names with glob syntax, but only `*` is expanded. Other wildcard characters such as `?` are *not* supported. Patterns can be repeated or combined with [logical operators] to specify multiple tags, but only union and negative intersection are supported.
1806
1807 [logical operators]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
1808 * `--tracked` — Fetch only tracked bookmarks and tags
1809
1810 This fetches only bookmarks and tags that are already tracked from the specified remote(s).
1811 * `--remote <REMOTE>` — The remote to fetch from (only named remotes are supported, can be repeated)
1812
1813 By default, the specified pattern matches remote names with glob syntax, e.g. `--remote '*'`. You can also use other [string pattern syntax].
1814
1815 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
1816 * `--all-remotes` — Fetch from all remotes
1817
1818
1819
1820 ## `jj git import`
1821
1822 Update repo with changes made in the underlying Git repo
1823
1824 Commits that are no longer reachable from any branch in the Git repo will be considered abandoned in the Git repo, and will be abandoned in the jj repo to match the Git repo. Set `git.abandon-unreachable-commits` to `false` to disable this behavior.
1825
1826 If a working-copy commit gets abandoned, it will be given a new, empty commit. This is true in general; it is not specific to this command.
1827
1828 By default, this command does nothing in colocated workspaces because the import happens automatically. Use `--ignore-working-copy` to forcibly import changes.
1829
1830 **Usage:** `jj git import`
1831
1832
1833
1834 ## `jj git init`
1835
1836 Create a new Git backed repo
1837
1838 **Usage:** `jj git init [OPTIONS] [DESTINATION]`
1839
1840 ###### **Arguments:**
1841
1842 * `<DESTINATION>` — The destination directory where the `jj` repo will be created. If the directory does not exist, it will be created. If no directory is given, the current directory is used.
1843
1844 By default the `git` repo is under `$destination/.jj`
1845
1846 Default value: `.`
1847
1848 ###### **Options:**
1849
1850 * `--colocate` — Colocate the Jujutsu repo with the git repo
1851
1852 Specifies that the `jj` repo should also be a valid `git` repo, allowing the use of both `jj` and `git` commands in the same directory.
1853
1854 The repository will contain a `.git` dir in the top-level. Regular Git tools will be able to operate on the repo.
1855
1856 **This is the default**, and this option has no effect, unless the [git.colocate config] is set to `false`.
1857
1858 This option is mutually exclusive with `--git-repo`.
1859
1860 [git.colocate config]: https://docs.jj-vcs.dev/latest/config/#default-colocation
1861 * `--no-colocate` — Disable colocation of the Jujutsu repo with the git repo
1862
1863 Prevent Git tools that are unaware of `jj` and regular Git commands from operating on the repo. The Git repository that stores most of the repo data will be hidden inside a sub-directory of the `.jj` directory.
1864
1865 See [colocation docs] for some minor advantages of non-colocated workspaces.
1866
1867 [colocation docs]: https://docs.jj-vcs.dev/latest/git-compatibility/#colocated-jujutsugit-repos
1868 * `--object-hash <OBJECT_HASH>` — Object hash algorithm for the newly created Git repository.
1869
1870 Corresponds to `git init`'s `--object-format` option. If not given, the [git.object-hash config] determines the default value.
1871
1872 Note that the object hash cannot currently be changed for an existing repo, and not all code forges support SHA-256 repositories yet. See also Git's [hash-function-transition] document for an in-depth explanation of the migration towards stronger hash functions.
1873
1874 [git.object-hash config]: https://docs.jj-vcs.dev/latest/config/#default-object-hash-format [hash-function-transition]: https://git-scm.com/docs/hash-function-transition
1875
1876 Possible values: `sha1`, `sha256`
1877
1878 * `--git-repo <GIT_REPO>` — Specifies a path to an **existing** git repository to be used as the backing git repo for the newly created `jj` repo.
1879
1880 If the specified `--git-repo` path happens to be the same as the `jj` repo path (both .jj and .git directories are in the same working directory), then both `jj` and `git` commands will work on the same repo. This is called a colocated workspace.
1881
1882 This option is mutually exclusive with `--colocate`, and so if passed, turns colocation off.
1883
1884
1885
1886 ## `jj git push`
1887
1888 Push to a Git remote
1889
1890 By default, pushes tracking bookmarks and tags pointing to `remote_bookmarks(remote=<remote>)..@`. Use `--bookmark`/`--tag` to push specific bookmarks or tags. Use `--all` to push all bookmarks and tags. Use `--change` to generate bookmark names based on the change IDs of specific commits.
1891
1892 When pushing a bookmark or tag, the command pushes all commits in the range from the remote's current position up to and including its target commit. Any descendant commits beyond the reference are not pushed.
1893
1894 If the local reference has changed from the last fetch, push will update the remote reference to the new position after passing safety checks. This is similar to `git push --force-with-lease` - the remote is updated only if its current state matches what Jujutsu last fetched.
1895
1896 Unlike in Git, the remote to push to is not derived from the tracked remote bookmarks. Use `--remote` to select the remote Git repository by name. There is no option to push to multiple remotes.
1897
1898 Before the command actually moves, creates, or deletes a remote bookmark, it makes several [safety checks]. If there is a problem, you may need to run `jj git fetch --remote <remote name>` and/or resolve some [bookmark conflicts].
1899
1900 [safety checks]: https://docs.jj-vcs.dev/latest/bookmarks/#pushing-bookmarks-safety-checks
1901
1902 [bookmark conflicts]: https://docs.jj-vcs.dev/latest/bookmarks/#conflicts
1903
1904 **Usage:** `jj git push [OPTIONS]`
1905
1906 ###### **Options:**
1907
1908 * `--remote <REMOTE>` — The remote to push to (only named remotes are supported)
1909
1910 This defaults to the `git.push` setting. If that is not configured, and if there are multiple remotes, the remote named "origin" will be used.
1911 * `-b`, `--bookmark <BOOKMARK>` — Push only this bookmark, or bookmarks matching a pattern (can be repeated)
1912
1913 If a bookmark isn't tracking anything yet, the remote bookmark will be tracked automatically.
1914
1915 By default, the specified pattern matches bookmark names with glob syntax. You can also use other [string pattern syntax].
1916
1917 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
1918 * `-t`, `--tag <TAG>` — Push only this tag, or tags matching a pattern (can be repeated)
1919
1920 If a tag isn't tracking anything yet, the remote tag will be tracked automatically.
1921
1922 By default, the specified pattern matches tag names with glob syntax. You can also use other [string pattern syntax].
1923
1924 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
1925 * `--all` — Push all bookmarks and tags (including new ones)
1926 * `--tracked` — Push all tracked bookmarks and tags
1927
1928 This usually means that the bookmark or tag was already pushed to or fetched from the [relevant remote].
1929
1930 [relevant remote]: https://docs.jj-vcs.dev/latest/bookmarks#remotes-and-tracked-bookmarks
1931 * `--deleted` — Push all deleted bookmarks and tags
1932
1933 Only tracked bookmarks and tags can be successfully deleted on the remote. A warning will be printed if any untracked bookmarks or tags on the remote correspond to missing local bookmarks or tags.
1934 * `--allow-empty-description` — Allow pushing commits with empty descriptions
1935 * `--allow-private` — Allow pushing commits that are private
1936
1937 The set of private commits can be configured by the `git.private-commits` setting. The default is `none()`, meaning all commits are eligible to be pushed.
1938 * `--allow-conflicts` — Allow pushing commits that contain conflicts
1939 * `-r`, `--revision <REVSETS>` — Push bookmarks and tags pointing to these commits (can be repeated)
1940 * `-c`, `--change <REVSETS>` — Push this commit by creating a bookmark (can be repeated)
1941
1942 The created bookmark will be tracked automatically. Use the `templates.git_push_bookmark` setting to customize the generated bookmark name. The default is `"push-" ++ change_id.short()`.
1943 * `--named <NAME=REVISION>` — Specify a new bookmark name and a revision to push under that name, e.g. '--named myfeature=@'
1944
1945 Automatically tracks the bookmark if it is new.
1946 * `--dry-run` — Only display what will change on the remote
1947 * `-o`, `--option <OPTION>` — Git push options
1948
1949
1950
1951 ## `jj git remote`
1952
1953 Manage Git remotes
1954
1955 The Git repo will be a bare git repo stored inside the `.jj/` directory.
1956
1957 **Usage:** `jj git remote <COMMAND>`
1958
1959 ###### **Subcommands:**
1960
1961 * `add` — Add a Git remote
1962 * `list` — List Git remotes
1963 * `remove` — Remove a Git remote and forget its bookmarks
1964 * `rename` — Rename a Git remote
1965 * `set-url` — Set the URL of a Git remote
1966
1967
1968
1969 ## `jj git remote add`
1970
1971 Add a Git remote
1972
1973 **Usage:** `jj git remote add [OPTIONS] <REMOTE> <URL>`
1974
1975 ###### **Arguments:**
1976
1977 * `<REMOTE>` — The remote's name
1978 * `<URL>` — The remote's URL or path
1979
1980 Local path will be resolved to absolute form.
1981
1982 ###### **Options:**
1983
1984 * `--push-url <PUSH_URL>` — The URL used for push
1985
1986 Local path will be resolved to absolute form
1987
1988
1989
1990 ## `jj git remote list`
1991
1992 List Git remotes
1993
1994 **Usage:** `jj git remote list`
1995
1996
1997
1998 ## `jj git remote remove`
1999
2000 Remove a Git remote and forget its bookmarks
2001
2002 **Usage:** `jj git remote remove <REMOTE>`
2003
2004 ###### **Arguments:**
2005
2006 * `<REMOTE>` — The remote's name
2007
2008
2009
2010 ## `jj git remote rename`
2011
2012 Rename a Git remote
2013
2014 **Usage:** `jj git remote rename <OLD> <NEW>`
2015
2016 ###### **Arguments:**
2017
2018 * `<OLD>` — The name of an existing remote
2019 * `<NEW>` — The desired name for `old`
2020
2021
2022
2023 ## `jj git remote set-url`
2024
2025 Set the URL of a Git remote
2026
2027 **Usage:** `jj git remote set-url [OPTIONS] <REMOTE> [URL]`
2028
2029 ###### **Arguments:**
2030
2031 * `<REMOTE>` — The remote's name
2032 * `<URL>` — The URL or path to fetch from
2033
2034 This is a short form, equivalent to using the explicit --fetch.
2035
2036 Local path will be resolved to absolute form.
2037
2038 ###### **Options:**
2039
2040 * `--push <PUSH>` — The URL or path to push to
2041
2042 Local path will be resolved to absolute form.
2043 * `--fetch <FETCH>` — The URL or path to fetch from
2044
2045 Local path will be resolved to absolute form.
2046
2047
2048
2049 ## `jj git root`
2050
2051 Show the underlying Git directory of a repository using the Git backend
2052
2053 **Usage:** `jj git root`
2054
2055
2056
2057 ## `jj help`
2058
2059 Print this message or the help of the given subcommand(s)
2060
2061 **Usage:** `jj help [OPTIONS] [COMMAND]...`
2062
2063 ###### **Arguments:**
2064
2065 * `<COMMAND>` — Print help for the subcommand(s)
2066
2067 ###### **Options:**
2068
2069 * `-k`, `--keyword <KEYWORD>` — Show help for keywords instead of commands
2070
2071 Possible values:
2072 - `bookmarks`:
2073 Named pointers to revisions (similar to Git's branches)
2074 - `config`:
2075 How and where to set configuration options
2076 - `filesets`:
2077 A functional language for selecting a set of files
2078 - `glossary`:
2079 Definitions of various terms
2080 - `revsets`:
2081 A functional language for selecting a set of revision
2082 - `templates`:
2083 A functional language to customize command output
2084 - `tutorial`:
2085 Show a tutorial to get started with jj
2086
2087
2088
2089
2090 ## `jj interdiff`
2091
2092 Show differences between the diffs of two revisions
2093
2094 This is like running `jj diff -r` on each change, then comparing those results. It answers: "How do the modifications introduced by revision A differ from the modifications introduced by revision B?"
2095
2096 For example, if two changes both add a feature but implement it differently, `jj interdiff --from @- --to other` shows what one implementation adds or removes that the other doesn't.
2097
2098 A common use of this command is to compare how a change has changed since the last push to a remote:
2099
2100 ```sh $ jj interdiff --from push-xyz@origin --to push-xyz ```
2101
2102 This command is different from `jj diff --from A --to B`, which compares file contents directly. `interdiff` compares what the changes do in terms of their patches, rather than their file contents. This makes a difference when the two revisions have different parents: `jj diff --from A --to B` will include the changes between their parents while `jj interdiff --from A --to B` will not.
2103
2104 Technically, this works by rebasing `--from` onto `--to`'s parents and comparing the result to `--to`.
2105
2106 To see the changes throughout the whole evolution of a change instead of between just two revisions, use `jj evolog -p` instead.
2107
2108 **Usage:** `jj interdiff [OPTIONS] <--from <REVSET>|--to <REVSET>> [FILESETS]...`
2109
2110 ###### **Arguments:**
2111
2112 * `<FILESETS>` — Restrict the diff to these paths
2113
2114 ###### **Options:**
2115
2116 * `-f`, `--from <REVSET>` — The first revision to compare (default: @)
2117 * `-t`, `--to <REVSET>` — The second revision to compare (default: @)
2118 * `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
2119 * `--stat` — Show a histogram of the changes
2120 * `--types` — For each path, show only its type before and after
2121
2122 The diff is shown as two letters. The first letter indicates the type before and the second letter indicates the type after. '-' indicates that the path was not present, 'F' represents a regular file, `L' represents a symlink, 'C' represents a conflict, and 'G' represents a Git submodule.
2123 * `--name-only` — For each path, show only its path
2124
2125 Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g`
2126 * `--git` — Show a Git-format diff
2127 * `--color-words` — Show a word-level diff with changes indicated only by color
2128 * `--tool <TOOL>` — Generate diff by external command
2129
2130 A builtin format can also be specified as `:<name>`. For example, `--tool=:git` is equivalent to `--git`.
2131 * `--context <CONTEXT>` — Number of lines of context to show
2132 * `-w`, `--ignore-all-space` — Ignore whitespace when comparing lines
2133 * `-b`, `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines
2134
2135
2136
2137 ## `jj log`
2138
2139 Show revision history
2140
2141 Renders a graphical view of the project's history, ordered with children before parents. By default, the output only includes mutable revisions, along with some additional revisions for context. Use `jj log -r ::` to see all revisions. See [`jj help -k revsets`] for information about the syntax.
2142
2143 [`jj help -k revsets`]: https://docs.jj-vcs.dev/latest/revsets/
2144
2145 Spans of revisions that are not included in the graph per `--revisions` are rendered as a synthetic node labeled "(elided revisions)".
2146
2147 The working-copy commit is indicated by a `@` symbol in the graph. [Immutable revisions] have a `◆` symbol. Other commits have a `○` symbol. All of these symbols can be [customized].
2148
2149 [Immutable revisions]: https://docs.jj-vcs.dev/latest/config/#set-of-immutable-commits
2150
2151 [customized]: https://docs.jj-vcs.dev/latest/config/#node-style
2152
2153 **Usage:** `jj log [OPTIONS] [FILESETS]...`
2154
2155 ###### **Arguments:**
2156
2157 * `<FILESETS>` — Show revisions modifying the given paths
2158
2159 ###### **Options:**
2160
2161 * `-r`, `--revision <REVSETS>` — Which revisions to show
2162
2163 If no paths nor revisions are specified, this defaults to the `revsets.log` setting.
2164 * `-n`, `--limit <LIMIT>` — Limit number of revisions to show
2165
2166 Applied after revisions are filtered and reordered topologically, but before being reversed.
2167 * `--reversed` — Show revisions in the opposite order (older revisions first)
2168 * `-G`, `--no-graph` — Show a flat list of revisions instead of a graph
2169 * `-T`, `--template <TEMPLATE>` — Render each revision using the given template
2170
2171 Run `jj log -T` to list the built-in templates.
2172
2173 You can also specify arbitrary template expressions using the [built-in keywords]. See [`jj help -k templates`] for more information.
2174
2175 If not specified, this defaults to the `templates.log` setting.
2176
2177 [built-in keywords]: https://docs.jj-vcs.dev/latest/templates/#commit-keywords
2178
2179 [`jj help -k templates`]: https://docs.jj-vcs.dev/latest/templates/
2180 * `-p`, `--patch` — Show patch
2181 * `--count` — Print the number of commits instead of showing them
2182 * `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
2183 * `--stat` — Show a histogram of the changes
2184 * `--types` — For each path, show only its type before and after
2185
2186 The diff is shown as two letters. The first letter indicates the type before and the second letter indicates the type after. '-' indicates that the path was not present, 'F' represents a regular file, `L' represents a symlink, 'C' represents a conflict, and 'G' represents a Git submodule.
2187 * `--name-only` — For each path, show only its path
2188
2189 Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g`
2190 * `--git` — Show a Git-format diff
2191 * `--color-words` — Show a word-level diff with changes indicated only by color
2192 * `--tool <TOOL>` — Generate diff by external command
2193
2194 A builtin format can also be specified as `:<name>`. For example, `--tool=:git` is equivalent to `--git`.
2195 * `--context <CONTEXT>` — Number of lines of context to show
2196 * `--ignore-all-space` — Ignore whitespace when comparing lines
2197 * `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines
2198
2199
2200
2201 ## `jj metaedit`
2202
2203 Modify the metadata of a revision without changing its content
2204
2205 Whenever any metadata is updated, the committer name, email, and timestamp are also updated for all rebased commits. The name and email may come from the `JJ_USER` and `JJ_EMAIL` environment variables, as well as by passing `--config user.name` and `--config user.email`.
2206
2207 **Usage:** `jj metaedit [OPTIONS] [REVSETS]...`
2208
2209 ###### **Arguments:**
2210
2211 * `<REVSETS>` — The revision(s) to modify (default: @) [aliases: -r]
2212
2213 ###### **Options:**
2214
2215 * `--update-change-id` — Generate a new change-id
2216
2217 This generates a new change-id for the revision.
2218 * `-m`, `--message <MESSAGE>` — Update the change description
2219
2220 This updates the change description, without opening the editor.
2221
2222 Use `jj describe` if you want to use an editor.
2223 * `--update-author-timestamp` — Update the author timestamp
2224
2225 This updates the author date to the current time, without modifying the author.
2226 * `--update-author` — Update the author to the configured user
2227
2228 This updates the author name and email. The author timestamp is not modified – use --update-author-timestamp to update the author timestamp.
2229
2230 You can use it in combination with the JJ_USER and JJ_EMAIL environment variables to set a different author:
2231
2232 $ JJ_USER='Foo Bar' [email protected] jj metaedit --update-author
2233 * `--author <AUTHOR>` — Set author to the provided string
2234
2235 This changes author name and email while retaining author timestamp for non-discardable commits.
2236
2237 ```shell $ jj metaedit --author "Foo Bar <[email protected]>" ```
2238 * `--author-timestamp <AUTHOR_TIMESTAMP>` — Set the author date to the given date
2239
2240 The date can either be human readable ([RFC2822], eg 'Sun, 23 Jan 2000 01:23:45 PST') or a time stamp ([RFC3339], eg '2000-01-23T01:23:45-08:00').
2241
2242 [RFC2822]: https://datatracker.ietf.org/doc/html/rfc2822
2243
2244 [RFC3339]: https://datatracker.ietf.org/doc/html/rfc3339
2245 * `--force-rewrite` — Rewrite the commit, even if no other metadata changed
2246
2247 This updates the committer timestamp to the current time, as well as the committer name and email.
2248
2249 Even if this option is not passed, the committer name, email, and timestamp will be updated if other metadata is updated. This option just forces every commit to be rewritten whether or not there are other changes.
2250
2251 You can use it in combination with the `JJ_USER` and `JJ_EMAIL` environment variables to set a different committer:
2252
2253 $ JJ_USER='Foo Bar' [email protected] jj metaedit --force-rewrite
2254
2255
2256
2257 ## `jj new`
2258
2259 Create a new, empty change and (by default) edit it in the working copy
2260
2261 By default, `jj` will edit the new change, making the [working copy] represent the new commit. This can be avoided with `--no-edit`.
2262
2263 Note that you can create a merge commit by specifying multiple revisions as argument. For example, `jj new @ main` will create a new commit with the working copy and the `main` bookmark as parents.
2264
2265 [working copy]: https://docs.jj-vcs.dev/latest/working-copy/
2266
2267 **Usage:** `jj new [OPTIONS] [REVSETS]...`
2268
2269 ###### **Arguments:**
2270
2271 * `<REVSETS>` — Parent(s) of the new change [default: @] [aliases: -o, -r]
2272
2273 ###### **Options:**
2274
2275 * `-m`, `--message <MESSAGE>` — The change description to use
2276 * `--no-edit` — Do not edit the newly created change
2277 * `-A`, `--insert-after <REVSETS>` [alias: `after`] — Insert the new change after the given commit(s)
2278
2279 Example: `jj new --insert-after A` creates a new change between `A` and
2280 its children:
2281
2282 ```text
2283 B C
2284 \ /
2285 B C => @
2286 \ / |
2287 A A
2288 ```
2289
2290 Specifying `--insert-after` multiple times will relocate all children of
2291 the given commits.
2292
2293 Example: `jj new --insert-after A --insert-after X` creates a change
2294 with `A` and `X` as parents, and rebases all children on top of the new
2295 change:
2296
2297 ```text
2298 B Y
2299 \ /
2300 B Y => @
2301 | | / \
2302 A X A X
2303 ```
2304 * `-B`, `--insert-before <REVSETS>` [alias: `before`] — Insert the new change before the given commit(s)
2305
2306 Example: `jj new --insert-before C` creates a new change between `C` and
2307 its parents:
2308
2309 ```text
2310 C
2311 |
2312 C => @
2313 / \ / \
2314 A B A B
2315 ```
2316
2317 `--insert-after` and `--insert-before` can be combined.
2318
2319 Example: `jj new --insert-after A --insert-before D`:
2320
2321 ```text
2322 D D
2323 | / \
2324 C | C
2325 | => @ |
2326 B | B
2327 | \ /
2328 A A
2329 ```
2330
2331 Similar to `--insert-after`, you can specify `--insert-before` multiple
2332 times.
2333
2334
2335
2336 ## `jj next`
2337
2338 Move the working-copy commit to the child revision
2339
2340 The command creates a new empty working copy revision that is the child of a
2341 descendant `offset` revisions ahead of the parent of the current working
2342 copy.
2343
2344 For example, when the offset is 1:
2345
2346 ```text
2347 D D @
2348 | |/
2349 C @ => C
2350 |/ |
2351 B B
2352 ```
2353
2354 If `--edit` is passed, the working copy revision is changed to the child of
2355 the current working copy revision.
2356
2357 ```text
2358 D D
2359 | |
2360 C C
2361 | |
2362 B => @
2363 | |
2364 @ A
2365 ```
2366
2367 **Usage:** `jj next [OPTIONS] [OFFSET]`
2368
2369 ###### **Arguments:**
2370
2371 * `<OFFSET>` — How many revisions to move forward. Advances to the next child by default
2372
2373 Default value: `1`
2374
2375 ###### **Options:**
2376
2377 * `-e`, `--edit` — Instead of creating a new working-copy commit on top of the target commit (like `jj new`), edit the target commit directly (like `jj edit`)
2378
2379 Takes precedence over config in `ui.movement.edit`; i.e. will negate `ui.movement.edit = false`
2380 * `-n`, `--no-edit` — The inverse of `--edit`
2381
2382 Takes precedence over config in `ui.movement.edit`; i.e. will negate `ui.movement.edit = true`
2383 * `--conflict` — Jump to the next conflicted descendant
2384
2385
2386
2387 ## `jj operation`
2388
2389 Commands for working with the operation log
2390
2391 See the [operation log documentation] for more information.
2392
2393 [operation log documentation]: https://docs.jj-vcs.dev/latest/operation-log/
2394
2395 **Usage:** `jj operation <COMMAND>`
2396
2397 **Command Alias:** `op`
2398
2399 ###### **Subcommands:**
2400
2401 * `abandon` — Abandon operation history
2402 * `diff` — Compare changes to the repository between two operations
2403 * `integrate` — Make an operation part of the operation log
2404 * `log` — Show the operation log
2405 * `restore` — Create a new operation that restores the repo to an earlier state
2406 * `revert` — Create a new operation that reverts an earlier operation
2407 * `show` — Show changes to the repository in an operation
2408
2409
2410
2411 ## `jj operation abandon`
2412
2413 Abandon operation history
2414
2415 To discard old operation history, use `jj op abandon ..<operation ID>`. It will abandon the specified operation and all its ancestors. The descendants will be reparented onto the root operation.
2416
2417 To discard recent operations, use `jj op restore <operation ID>` followed by `jj op abandon <operation ID>..@-`.
2418
2419 Previous versions of a change (or predecessors) are also discarded if they become unreachable from the operation history. The abandoned operations, commits, and other unreachable objects can later be garbage collected by using `jj util gc` command.
2420
2421 **Usage:** `jj operation abandon <OPERATION>`
2422
2423 ###### **Arguments:**
2424
2425 * `<OPERATION>` — The operation or operation range to abandon
2426
2427
2428
2429 ## `jj operation diff`
2430
2431 Compare changes to the repository between two operations
2432
2433 **Usage:** `jj operation diff [OPTIONS]`
2434
2435 ###### **Options:**
2436
2437 * `--operation <OPERATION>` [alias: `op`] — Show repository changes in this operation, compared to its parent
2438 * `-f`, `--from <FROM>` — Show repository changes from this operation
2439 * `-t`, `--to <TO>` — Show repository changes to this operation
2440 * `-G`, `--no-graph` — Show a flat list of modified changes instead of a graph
2441 * `-p`, `--patch` — Show patch of modifications to changes
2442
2443 If the previous version has different parents, it will be temporarily rebased to the parents of the new version, so the diff is not contaminated by unrelated changes.
2444 * `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
2445 * `--stat` — Show a histogram of the changes
2446 * `--types` — For each path, show only its type before and after
2447
2448 The diff is shown as two letters. The first letter indicates the type before and the second letter indicates the type after. '-' indicates that the path was not present, 'F' represents a regular file, `L' represents a symlink, 'C' represents a conflict, and 'G' represents a Git submodule.
2449 * `--name-only` — For each path, show only its path
2450
2451 Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g`
2452 * `--git` — Show a Git-format diff
2453 * `--color-words` — Show a word-level diff with changes indicated only by color
2454 * `--tool <TOOL>` — Generate diff by external command
2455
2456 A builtin format can also be specified as `:<name>`. For example, `--tool=:git` is equivalent to `--git`.
2457 * `--context <CONTEXT>` — Number of lines of context to show
2458 * `--ignore-all-space` — Ignore whitespace when comparing lines
2459 * `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines
2460 * `--show-changes-in <REVSETS>` — Show only changed revisions matching the given revset expression
2461
2462 If no revisions are specified, this defaults to the `revsets.op-diff-changes-in` setting.
2463
2464
2465
2466 ## `jj operation integrate`
2467
2468 Make an operation part of the operation log
2469
2470 By default, operations are automatically integrated into the operation log, but `--no-integrate-operation` or internal errors may cause that to not happen. This command can then be used for making such operations part of the operation log.
2471
2472 Running this command on an operation that is already in the operation log (`jj op log`) has no effect.
2473
2474 **Usage:** `jj operation integrate <OPERATION>`
2475
2476 ###### **Arguments:**
2477
2478 * `<OPERATION>` — The operation to integrate
2479
2480
2481
2482 ## `jj operation log`
2483
2484 Show the operation log
2485
2486 Like other commands, `jj op log` snapshots the current working-copy changes and reconciles divergent operations. Use `--at-op=@ --ignore-working-copy` to inspect the current state without mutation.
2487
2488 **Usage:** `jj operation log [OPTIONS]`
2489
2490 ###### **Options:**
2491
2492 * `-n`, `--limit <LIMIT>` — Limit number of operations to show
2493
2494 Applied after operations are reordered topologically, but before being reversed.
2495 * `--reversed` — Show operations in the opposite order (older operations first)
2496 * `-G`, `--no-graph` — Show a flat list of operations instead of a graph
2497 * `-T`, `--template <TEMPLATE>` — Render each operation using the given template
2498
2499 You can specify arbitrary template expressions using the [built-in keywords]. See [`jj help -k templates`] for more information.
2500
2501 [built-in keywords]: https://docs.jj-vcs.dev/latest/templates/#operation-keywords
2502
2503 [`jj help -k templates`]: https://docs.jj-vcs.dev/latest/templates/
2504 * `-d`, `--op-diff` — Show changes to the repository at each operation
2505 * `-p`, `--patch` — Show patch of modifications to changes (implies --op-diff)
2506
2507 If the previous version has different parents, it will be temporarily rebased to the parents of the new version, so the diff is not contaminated by unrelated changes.
2508 * `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
2509 * `--stat` — Show a histogram of the changes
2510 * `--types` — For each path, show only its type before and after
2511
2512 The diff is shown as two letters. The first letter indicates the type before and the second letter indicates the type after. '-' indicates that the path was not present, 'F' represents a regular file, `L' represents a symlink, 'C' represents a conflict, and 'G' represents a Git submodule.
2513 * `--name-only` — For each path, show only its path
2514
2515 Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g`
2516 * `--git` — Show a Git-format diff
2517 * `--color-words` — Show a word-level diff with changes indicated only by color
2518 * `--tool <TOOL>` — Generate diff by external command
2519
2520 A builtin format can also be specified as `:<name>`. For example, `--tool=:git` is equivalent to `--git`.
2521 * `--context <CONTEXT>` — Number of lines of context to show
2522 * `--ignore-all-space` — Ignore whitespace when comparing lines
2523 * `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines
2524 * `--show-changes-in <REVSETS>` — Show only changed revisions matching the given revset expression
2525
2526 If no revisions are specified, this defaults to the `revsets.op-diff-changes-in` setting.
2527
2528
2529
2530 ## `jj operation restore`
2531
2532 Create a new operation that restores the repo to an earlier state
2533
2534 This restores the repo to the state at the specified operation, effectively undoing all later operations. It does so by creating a new operation.
2535
2536 **Usage:** `jj operation restore [OPTIONS] <OPERATION>`
2537
2538 ###### **Arguments:**
2539
2540 * `<OPERATION>` — The operation to restore to
2541
2542 Use `jj op log` to find an operation to restore to. Use e.g. `jj --at-op=<operation ID> log` before restoring to an operation to see the state of the repo at that operation.
2543
2544 ###### **Options:**
2545
2546 * `--what <WHAT>` — What portions of the local state to restore (can be repeated)
2547
2548 This option is EXPERIMENTAL.
2549
2550 Default values: `repo`, `remote-tracking`
2551
2552 Possible values:
2553 - `repo`:
2554 The jj repo state and local bookmarks
2555 - `remote-tracking`:
2556 The remote-tracking bookmarks. Do not restore these if you'd like to push after the undo
2557
2558
2559
2560
2561 ## `jj operation revert`
2562
2563 Create a new operation that reverts an earlier operation
2564
2565 This reverts an individual operation by applying the inverse of the operation.
2566
2567 **Usage:** `jj operation revert [OPTIONS] [OPERATION]`
2568
2569 ###### **Arguments:**
2570
2571 * `<OPERATION>` — The operation to revert
2572
2573 Use `jj op log` to find an operation to revert.
2574
2575 Default value: `@`
2576
2577 ###### **Options:**
2578
2579 * `--what <WHAT>` — What portions of the local state to restore (can be repeated)
2580
2581 This option is EXPERIMENTAL.
2582
2583 Default values: `repo`, `remote-tracking`
2584
2585 Possible values:
2586 - `repo`:
2587 The jj repo state and local bookmarks
2588 - `remote-tracking`:
2589 The remote-tracking bookmarks. Do not restore these if you'd like to push after the undo
2590
2591
2592
2593
2594 ## `jj operation show`
2595
2596 Show changes to the repository in an operation
2597
2598 **Usage:** `jj operation show [OPTIONS] [OPERATION]`
2599
2600 ###### **Arguments:**
2601
2602 * `<OPERATION>` — Show repository changes in this operation, compared to its parent(s)
2603
2604 Default value: `@`
2605
2606 ###### **Options:**
2607
2608 * `-G`, `--no-graph` — Show a flat list of modified changes instead of a graph
2609 * `-T`, `--template <TEMPLATE>` — Render the operation using the given template
2610
2611 You can specify arbitrary template expressions using the [built-in keywords]. See [`jj help -k templates`] for more information.
2612
2613 [built-in keywords]: https://docs.jj-vcs.dev/latest/templates/#operation-keywords
2614
2615 [`jj help -k templates`]: https://docs.jj-vcs.dev/latest/templates/
2616 * `-p`, `--patch` — Show patch of modifications to changes
2617
2618 If the previous version has different parents, it will be temporarily rebased to the parents of the new version, so the diff is not contaminated by unrelated changes.
2619 * `--no-op-diff` — Do not show operation diff
2620 * `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
2621 * `--stat` — Show a histogram of the changes
2622 * `--types` — For each path, show only its type before and after
2623
2624 The diff is shown as two letters. The first letter indicates the type before and the second letter indicates the type after. '-' indicates that the path was not present, 'F' represents a regular file, `L' represents a symlink, 'C' represents a conflict, and 'G' represents a Git submodule.
2625 * `--name-only` — For each path, show only its path
2626
2627 Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g`
2628 * `--git` — Show a Git-format diff
2629 * `--color-words` — Show a word-level diff with changes indicated only by color
2630 * `--tool <TOOL>` — Generate diff by external command
2631
2632 A builtin format can also be specified as `:<name>`. For example, `--tool=:git` is equivalent to `--git`.
2633 * `--context <CONTEXT>` — Number of lines of context to show
2634 * `--ignore-all-space` — Ignore whitespace when comparing lines
2635 * `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines
2636 * `--show-changes-in <REVSETS>` — Show only changed revisions matching the given revset expression
2637
2638 If no revisions are specified, this defaults to the `revsets.op-diff-changes-in` setting.
2639
2640
2641
2642 ## `jj parallelize`
2643
2644 Parallelize revisions by making them siblings
2645
2646 Running `jj parallelize 1::2` will transform the history like this:
2647 ```text
2648 3
2649 | 3
2650 2 / \
2651 | -> 1 2
2652 1 \ /
2653 | 0
2654 0
2655 ```
2656
2657 The command effectively says "these revisions are actually independent",
2658 meaning that they should no longer be ancestors/descendants of each other.
2659 However, revisions outside the set that were previously ancestors of a
2660 revision in the set will remain ancestors of it. For example, revision 0
2661 above remains an ancestor of both 1 and 2. Similarly,
2662 revisions outside the set that were previously descendants of a revision
2663 in the set will remain descendants of it. For example, revision 3 above
2664 remains a descendant of both 1 and 2.
2665
2666 Therefore, `jj parallelize '1 | 3'` is a no-op. That's because 2, which is
2667 not in the target set, was a descendant of 1 before, so it remains a
2668 descendant, and it was an ancestor of 3 before, so it remains an ancestor.
2669
2670 **Usage:** `jj parallelize [REVSETS]...`
2671
2672 ###### **Arguments:**
2673
2674 * `<REVSETS>` — The revisions to parallelize [aliases: -r]
2675
2676
2677
2678 ## `jj prev`
2679
2680 Change the working copy revision relative to the parent revision
2681
2682 The command creates a new empty working copy revision that is the child of
2683 an ancestor `offset` revisions behind the parent of the current working
2684 copy.
2685
2686 For example, when the offset is 1:
2687
2688 ```text
2689 D @ D
2690 |/ |
2691 A => A @
2692 | |/
2693 B B
2694 ```
2695
2696 If `--edit` is passed, the working copy revision is changed to the parent of
2697 the current working copy revision.
2698
2699 ```text
2700 D @ D
2701 |/ |
2702 C => @
2703 | |
2704 B B
2705 | |
2706 A A
2707 ```
2708
2709 **Usage:** `jj prev [OPTIONS] [OFFSET]`
2710
2711 ###### **Arguments:**
2712
2713 * `<OFFSET>` — How many revisions to move backward. Moves to the parent by default
2714
2715 Default value: `1`
2716
2717 ###### **Options:**
2718
2719 * `-e`, `--edit` — Edit the parent directly, instead of moving the working-copy commit
2720
2721 Takes precedence over config in `ui.movement.edit`; i.e. will negate `ui.movement.edit = false`
2722 * `-n`, `--no-edit` — The inverse of `--edit`
2723
2724 Takes precedence over config in `ui.movement.edit`; i.e. will negate `ui.movement.edit = true`
2725 * `--conflict` — Jump to the previous conflicted ancestor
2726
2727
2728
2729 ## `jj rebase`
2730
2731 Move revisions to different parent(s)
2732
2733 This command moves revisions to different parent(s) while preserving the
2734 changes (diff) in the revisions.
2735
2736 There are three different ways of specifying which revisions to rebase:
2737
2738 * `--source/-s` to rebase a revision and its descendants
2739 * `--branch/-b` to rebase a whole branch, relative to the destination
2740 * `--revisions/-r` to rebase the specified revisions without their
2741 descendants
2742
2743 If no option is specified, it defaults to `-b @`.
2744
2745 There are three different ways of specifying where the revisions should be
2746 rebased to:
2747
2748 * `--onto/-o` to rebase the revisions onto the specified targets
2749 * `--insert-after/-A` to rebase the revisions onto the specified targets and
2750 to rebase the targets' descendants onto the rebased revisions
2751 * `--insert-before/-B` to rebase the revisions onto the specified targets'
2752 parents and to rebase the targets and their descendants onto the rebased
2753 revisions
2754
2755 See the sections below for details about the different ways of specifying
2756 which revisions to rebase where.
2757
2758 If a working-copy revision gets abandoned, it will be given a new, empty
2759 revision. This is true in general; it is not specific to this command.
2760
2761 ### Specifying which revisions to rebase
2762
2763 With `--source/-s`, the command rebases the specified revision and its
2764 descendants to the destination. For example, `jj rebase -s M -o O` would
2765 transform your history like this (letters followed by an apostrophe are
2766 post-rebase versions):
2767
2768 ```text
2769 O N'
2770 | |
2771 | N M'
2772 | | |
2773 | M O
2774 | | => |
2775 | | L | L
2776 | |/ | |
2777 | K | K
2778 |/ |/
2779 J J
2780 ```
2781
2782 Each revision passed to `-s` will become a direct child of the destination,
2783 so if you instead run `jj rebase -s M -s N -o O` (or `jj rebase -s 'M|N' -o
2784 O`) in the example above, then N' would instead be a direct child of O.
2785
2786 With `--branch/-b`, the command rebases the whole "branch" containing the
2787 specified revision. A "branch" is the set of revisions that includes:
2788
2789 * the specified revision and ancestors that are not also ancestors of the
2790 destination
2791 * all descendants of those revisions
2792
2793 In other words, `jj rebase -b X -o Y` rebases revisions in the revset
2794 `(Y..X)::` (which is equivalent to `jj rebase -s 'roots(Y..X)' -o Y` for a
2795 single root). For example, either `jj rebase -b L -o O` or `jj rebase -b M
2796 -o O` would transform your history like this (because `L` and `M` are on the
2797 same "branch", relative to the destination):
2798
2799 ```text
2800 O N'
2801 | |
2802 | N M'
2803 | | |
2804 | M | L'
2805 | | => |/
2806 | | L K'
2807 | |/ |
2808 | K O
2809 |/ |
2810 J J
2811 ```
2812
2813 With `--revisions/-r`, the command rebases only the specified revisions to
2814 the destination. Any "hole" left behind will be filled by rebasing
2815 descendants onto the specified revisions' parent(s). For example,
2816 `jj rebase -r K -o M` would transform your history like this:
2817
2818 ```text
2819 M K'
2820 | |
2821 | L M
2822 | | => |
2823 | K | L'
2824 |/ |/
2825 J J
2826 ```
2827
2828 Multiple revisions can be specified, and any dependencies (graph edges)
2829 within the set will be preserved. For example, `jj rebase -r 'K|N' -o O`
2830 would transform your history like this:
2831
2832 ```text
2833 O N'
2834 | |
2835 | N K'
2836 | | |
2837 | M O
2838 | | => |
2839 | | L | M'
2840 | |/ |/
2841 | K | L'
2842 |/ |/
2843 J J
2844 ```
2845
2846 `jj rebase -s X` is similar to `jj rebase -r X::` and will behave the same
2847 if X is a single revision. However, if X is a set of multiple revisions,
2848 or if you passed multiple `-s` arguments, then `jj rebase -s` will make each
2849 of the specified revisions an immediate child of the destination, while
2850 `jj rebase -r` will preserve dependencies within the set.
2851
2852 Note that you can create a merge revision by repeating the `-o` argument.
2853 For example, if you realize that revision L actually depends on revision M
2854 in order to work (in addition to its current parent K), you can run `jj
2855 rebase -s L -o K -o M`:
2856
2857 ```text
2858 M L'
2859 | |\
2860 | L M |
2861 | | => | |
2862 | K | K
2863 |/ |/
2864 J J
2865 ```
2866
2867 ### Specifying where to rebase the revisions
2868
2869 With `--onto/-o`, the command rebases the selected revisions onto the
2870 targets. Existing descendants of the targets will not be affected. See
2871 the section above for examples.
2872
2873 With `--insert-after/-A`, the selected revisions will be inserted after the
2874 targets. This is similar to `-o`, but if the targets have any existing
2875 descendants, then those will be rebased onto the rebased selected revisions.
2876
2877 For example, `jj rebase -r K -A L` will rewrite history like this:
2878 ```text
2879 N N'
2880 | |
2881 | M | M'
2882 |/ |/
2883 L => K'
2884 | |
2885 | K L
2886 |/ |
2887 J J
2888 ```
2889
2890 The `-A` (and `-B`) argument can also be used for reordering revisions. For
2891 example, `jj rebase -r M -A J` will rewrite history like this:
2892 ```text
2893 M L'
2894 | |
2895 L K'
2896 | => |
2897 K M'
2898 | |
2899 J J
2900 ```
2901
2902 With `--insert-before/-B`, the selected revisions will be inserted before
2903 the targets. This is achieved by rebasing the selected revisions onto the
2904 target revisions' parents, and then rebasing the target revisions and their
2905 descendants onto the rebased revisions.
2906
2907 For example, `jj rebase -r K -B L` will rewrite history like this:
2908 ```text
2909 N N'
2910 | |
2911 | M | M'
2912 |/ |/
2913 L => L'
2914 | |
2915 | K K'
2916 |/ |
2917 J J
2918 ```
2919
2920 The `-A` and `-B` arguments can also be combined, which can be useful around
2921 merges. For example, you can use `jj rebase -r K -A J -B M` to create a new
2922 merge (but `jj rebase -r M -o L -o K` might be simpler in this particular
2923 case):
2924 ```text
2925 M M'
2926 | |\
2927 L L |
2928 | => | |
2929 | K | K'
2930 |/ |/
2931 J J
2932 ```
2933
2934 To insert a commit inside an existing merge with `jj rebase -r O -A K -B M`:
2935 ```text
2936 O N'
2937 | |\
2938 N | M'
2939 |\ | |\
2940 | M | O'|
2941 | | => |/ /
2942 | L | L
2943 | | | |
2944 K | K |
2945 |/ |/
2946 J J
2947 ```
2948
2949 **Usage:** `jj rebase [OPTIONS] <--onto <REVSETS>|--insert-after <REVSETS>|--insert-before <REVSETS>>`
2950
2951 ###### **Options:**
2952
2953 * `-b`, `--branch <REVSETS>` — Rebase the whole branch relative to destination's ancestors (can be repeated)
2954
2955 `jj rebase -b=br -o=dst` is equivalent to `jj rebase '-s=roots(dst..br)' -o=dst`.
2956
2957 If none of `-b`, `-s`, or `-r` is provided, then the default is `-b @`.
2958 * `-s`, `--source <REVSETS>` — Rebase specified revision(s) together with their trees of descendants (can be repeated)
2959
2960 Each specified revision will become a direct child of the destination revision(s), even if some of the source revisions are descendants of others.
2961
2962 If none of `-b`, `-s`, or `-r` is provided, then the default is `-b @`.
2963 * `-r`, `--revision <REVSETS>` — Rebase the given revisions, rebasing descendants onto this revision's parent(s)
2964
2965 Unlike `-s` or `-b`, you may `jj rebase -r` a revision `A` onto a descendant of `A`.
2966
2967 If none of `-b`, `-s`, or `-r` is provided, then the default is `-b @`.
2968 * `-o`, `--onto <REVSETS>` [alias: `destination`] — The revision(s) to rebase onto (can be repeated to create a merge commit)
2969 * `-A`, `--insert-after <REVSETS>` [alias: `after`] — The revision(s) to insert after (can be repeated to create a merge commit)
2970 * `-B`, `--insert-before <REVSETS>` [alias: `before`] — The revision(s) to insert before (can be repeated to create a merge commit)
2971 * `--skip-emptied` — If true, when rebasing would produce an empty commit, the commit is abandoned. It will not be abandoned if it was already empty before the rebase. Will never skip merge commits with multiple non-empty parents
2972 * `--keep-divergent` — Keep divergent commits while rebasing
2973
2974 Without this flag, divergent commits are abandoned while rebasing if another commit with the same change ID is already present in the destination with identical changes.
2975 * `--simplify-parents` — Simplify parents of rebased commits, like `jj simplify-parents`, while rebasing them. Any parents that are ancestors of other parents will be removed
2976
2977
2978
2979 ## `jj redo`
2980
2981 Redo the most recently undone operation
2982
2983 This is the natural counterpart of `jj undo`. Repeated invocations of `jj undo` and `jj redo` act similarly to Undo/Redo commands in a text editor.
2984
2985 Use `jj op log` to visualize the log of past operations, including a detailed description of any past undo/redo operations. See also `jj op restore` to explicitly restore an older operation by its id (available in the operation log).
2986
2987 **Usage:** `jj redo`
2988
2989
2990
2991 ## `jj resolve`
2992
2993 Resolve conflicted files with an external merge tool
2994
2995 Only conflicts that can be resolved with a 3-way merge are supported. See docs for merge tool configuration instructions. External merge tools will be invoked for each conflicted file one-by-one until all conflicts are resolved. To stop resolving conflicts, exit the merge tool without making any changes.
2996
2997 Note that conflicts can also be resolved without using this command. You may edit the conflict markers in the conflicted file directly with a text editor.
2998
2999 **Usage:** `jj resolve [OPTIONS] [FILESETS]...`
3000
3001 ###### **Arguments:**
3002
3003 * `<FILESETS>` — Only resolve conflicts in these paths. You can use the `--list` argument to find paths to use here
3004
3005 ###### **Options:**
3006
3007 * `-r`, `--revision <REVSET>`
3008
3009 Default value: `@`
3010 * `-l`, `--list` — Instead of resolving conflicts, list all the conflicts
3011 * `--tool <NAME>` — Specify 3-way merge tool to be used
3012
3013 The built-in merge tools `:ours` and `:theirs` can be used to choose side #1 and side #2 of the conflict respectively.
3014
3015
3016
3017 ## `jj restore`
3018
3019 Restore paths from another revision
3020
3021 That means that the paths get the same content in the destination (`--into`) as they had in the source (`--from`). This is typically used for undoing changes to some paths in the working copy (`jj restore <paths>`).
3022
3023 If only one of `--from` or `--into` is specified, the other one defaults to the working copy.
3024
3025 When neither `--from` nor `--into` is specified, the command restores into the working copy from its parent(s). `jj restore` without arguments is similar to `jj abandon`, except that it leaves an empty revision with its description and other metadata preserved.
3026
3027 See `jj diffedit` if you'd like to restore portions of files rather than entire files.
3028
3029 **Usage:** `jj restore [OPTIONS] [FILESETS]...`
3030
3031 ###### **Arguments:**
3032
3033 * `<FILESETS>` — Restore only these paths (instead of all paths)
3034
3035 ###### **Options:**
3036
3037 * `-f`, `--from <REVSET>` — Revision to restore from (source)
3038 * `-t`, `--into <REVSET>` [alias: `to`] — Revision to restore into (destination)
3039 * `-c`, `--changes-in <REVSET>` — Undo the changes in a revision as compared to the merge of its parents.
3040
3041 This undoes the changes that can be seen with `jj diff -r REVSET`. If `REVSET` only has a single parent, this option is equivalent to `jj restore --into REVSET --from REVSET-`.
3042
3043 The default behavior of `jj restore` is equivalent to `jj restore --changes-in @`.
3044 * `-i`, `--interactive` — Interactively choose which parts to restore
3045 * `--tool <NAME>` — Specify diff editor to be used (implies --interactive)
3046 * `--restore-descendants` — Preserve the content (not the diff) when rebasing descendants
3047
3048
3049
3050 ## `jj revert`
3051
3052 Apply the reverse of the given revision(s)
3053
3054 The reverse of each of the given revisions is applied sequentially in reverse topological order at the given location.
3055
3056 The description of the new revisions can be customized with the `templates.revert_description` config variable.
3057
3058 **Usage:** `jj revert --revision <REVSETS> <--onto <REVSETS>|--insert-after <REVSETS>|--insert-before <REVSETS>>`
3059
3060 ###### **Options:**
3061
3062 * `-r`, `--revision <REVSETS>` — The revision(s) to apply the reverse of
3063 * `-o`, `--onto <REVSETS>` [alias: `destination`] — The revision(s) to apply the reverse changes on top of
3064 * `-A`, `--insert-after <REVSETS>` [alias: `after`] — The revision(s) to insert the reverse changes after (can be repeated to create a merge commit)
3065 * `-B`, `--insert-before <REVSETS>` [alias: `before`] — The revision(s) to insert the reverse changes before (can be repeated to create a merge commit)
3066
3067
3068
3069 ## `jj root`
3070
3071 Show the current workspace root directory (shortcut for `jj workspace root`)
3072
3073 **Usage:** `jj root`
3074
3075
3076
3077 ## `jj run`
3078
3079 Run a command across a set of revisions.
3080
3081 Checks out each revision in an isolated working copy, runs the command, then
3082 amends the revision with the resulting working copy. By default, descendants
3083 are rebased on top of the amended revisions, propagating the diff. Use
3084 `--restore-descendants` to keep descendants' content unchanged instead, or
3085 `--ignore-changes` to run the command without rewriting any commits.
3086
3087 The command is executed with the following environment variables set:
3088
3089 - JJ_CHANGE_ID
3090 - JJ_COMMIT_ID
3091 - JJ_WORKSPACE_ROOT
3092
3093 ### Example
3094
3095 ```shell
3096 # Run pre-commit on your local work
3097 $ jj run -j 4 -- pre-commit run .github/pre-commit.yaml
3098 ```
3099
3100 **Usage:** `jj run [OPTIONS] <COMMAND> [ARGS]...`
3101
3102 ###### **Arguments:**
3103
3104 * `<COMMAND>` — Command to run across all selected revisions
3105 * `<ARGS>` — Arguments to pass to the command
3106
3107 Hint: Use a `--` separator to allow passing arguments starting with `-`. For example `jj run --revisions=... -- cargo build --release`.
3108
3109 ###### **Options:**
3110
3111 * `-r`, `--revision <REVSETS>` — The revisions to change
3112 * `-j`, `--jobs <JOBS>` — How many processes should run in parallel
3113
3114 Overrides the `run.jobs` config setting. Defaults to 1 if neither is set.
3115 * `--root` — Run the command from the working-copy root in each commit instead of from the subdirectory `jj run` was invoked from
3116 * `--clean` — Delete each working copy before running the command
3117
3118 By default `jj run` reuses working copies between invocations so build artifacts are preserved. With `--clean`, every commit starts from a freshly checked-out tree.
3119 * `--restore-descendants` — Preserve the content (not the diff) when rebasing descendants
3120 * `--passthrough` — Pass through stdout and stderr directly to the terminal
3121
3122 The command's stdout and stderr are connected directly to the terminal (instead of being captured), so programs that behave differently on a TTY (e.g. colored output, progress bars) work as expected. Stdin is not inherited. Only one job is allowed since parallel jobs would interleave their output.
3123 * `--ignore-changes` — Run the command without rewriting any commits.
3124
3125 Each revision is checked out and the command is executed, but changes made to the working copy are discarded. Useful for read-only checks (tests, linters).
3126
3127 This option permits running on immutable commits without passing `--ignore-immutable`.
3128 * `--ignore-errors` — Continue with remaining revisions when a command's exit code indicates failure
3129
3130 Any changes made by a failed command will not be saved, but changes from successful commands are still applied atomically at the end.
3131
3132 The exit code from any failed command will not impact the exit code of `jj run` itself.
3133
3134
3135
3136 ## `jj show`
3137
3138 Show revision metadata and diff
3139
3140 **Usage:** `jj show [OPTIONS] [REVSETS]...`
3141
3142 ###### **Arguments:**
3143
3144 * `<REVSETS>` — Show changes in these revisions, compared to their parent(s) [default: @] [aliases: -r]
3145
3146 ###### **Options:**
3147
3148 * `--reversed` — Show revisions in the opposite order (older revisions first)
3149 * `-T`, `--template <TEMPLATE>` — Render each revision using the given template
3150
3151 You can specify arbitrary template expressions using the [built-in keywords]. See [`jj help -k templates`] for more information.
3152
3153 [built-in keywords]: https://docs.jj-vcs.dev/latest/templates/#commit-keywords
3154
3155 [`jj help -k templates`]: https://docs.jj-vcs.dev/latest/templates/
3156 * `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
3157 * `--stat` — Show a histogram of the changes
3158 * `--types` — For each path, show only its type before and after
3159
3160 The diff is shown as two letters. The first letter indicates the type before and the second letter indicates the type after. '-' indicates that the path was not present, 'F' represents a regular file, `L' represents a symlink, 'C' represents a conflict, and 'G' represents a Git submodule.
3161 * `--name-only` — For each path, show only its path
3162
3163 Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g`
3164 * `--git` — Show a Git-format diff
3165 * `--color-words` — Show a word-level diff with changes indicated only by color
3166 * `--tool <TOOL>` — Generate diff by external command
3167
3168 A builtin format can also be specified as `:<name>`. For example, `--tool=:git` is equivalent to `--git`.
3169 * `--context <CONTEXT>` — Number of lines of context to show
3170 * `--no-patch` — Do not show the patch
3171 * `-w`, `--ignore-all-space` — Ignore whitespace when comparing lines
3172 * `-b`, `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines
3173
3174
3175
3176 ## `jj sign`
3177
3178 Cryptographically sign a revision
3179
3180 This command requires configuring a [commit signing] backend.
3181
3182 [commit signing]: https://docs.jj-vcs.dev/latest/config/#commit-signing
3183
3184 **Usage:** `jj sign [OPTIONS]`
3185
3186 ###### **Options:**
3187
3188 * `-r`, `--revision <REVSETS>` — What revision(s) to sign
3189
3190 If no revisions are specified, this defaults to the `revsets.sign` setting.
3191
3192 Note that revisions are always re-signed.
3193
3194 While that leads to discomfort for users, which sign with hardware devices, as of now we cannot reliably check if a commit is already signed by the user without creating a signature (see [#5786]).
3195
3196 [#5786]: https://github.com/jj-vcs/jj/issues/5786
3197 * `--key <KEY>` — The key used for signing
3198
3199
3200
3201 ## `jj simplify-parents`
3202
3203 Simplify parent edges for the specified revision(s).
3204
3205 Removes all parents of each of the specified revisions that are also indirect ancestors of the same revisions through other parents. This has no effect on any revision's contents, including the working copy.
3206
3207 In other words, for all (A, B, C) where A has (B, C) as parents and C is an ancestor of B, A will be rewritten to have only B as a parent instead of B+C.
3208
3209 **Usage:** `jj simplify-parents [OPTIONS]`
3210
3211 ###### **Options:**
3212
3213 * `-s`, `--source <REVSETS>` — Simplify specified revision(s) together with their trees of descendants (can be repeated)
3214 * `-r`, `--revision <REVSETS>` — Simplify specified revision(s) (can be repeated)
3215
3216 If both `--source` and `--revisions` are not provided, this defaults to the `revsets.simplify-parents` setting, or `reachable(@, mutable())` if it is not set.
3217
3218
3219
3220 ## `jj sparse`
3221
3222 Manage which paths from the working-copy commit are present in the working copy
3223
3224 **Usage:** `jj sparse <COMMAND>`
3225
3226 ###### **Subcommands:**
3227
3228 * `edit` — Start an editor to update the patterns that are present in the working copy
3229 * `list` — List the patterns that are currently present in the working copy
3230 * `reset` — Reset the patterns to include all files in the working copy
3231 * `set` — Update the patterns that are present in the working copy
3232
3233
3234
3235 ## `jj sparse edit`
3236
3237 Start an editor to update the patterns that are present in the working copy
3238
3239 **Usage:** `jj sparse edit`
3240
3241
3242
3243 ## `jj sparse list`
3244
3245 List the patterns that are currently present in the working copy
3246
3247 By default, a newly cloned or initialized repo will have have a pattern matching all files from the repo root. That pattern is rendered as `.` (a single period).
3248
3249 **Usage:** `jj sparse list`
3250
3251
3252
3253 ## `jj sparse reset`
3254
3255 Reset the patterns to include all files in the working copy
3256
3257 **Usage:** `jj sparse reset`
3258
3259
3260
3261 ## `jj sparse set`
3262
3263 Update the patterns that are present in the working copy
3264
3265 For example, if all you need is the `README.md` and the `lib/` directory, use `jj sparse set --clear --add README.md --add lib`. If you no longer need the `lib` directory, use `jj sparse set --remove lib`.
3266
3267 **Usage:** `jj sparse set [OPTIONS]`
3268
3269 ###### **Options:**
3270
3271 * `--add <ADD>` — Patterns to add to the working copy
3272 * `--remove <REMOVE>` — Patterns to remove from the working copy
3273 * `--clear` — Include no files in the working copy (combine with --add)
3274
3275
3276
3277 ## `jj split`
3278
3279 Split a revision in two
3280
3281 Starts a [diff editor] on the changes in the revision. Edit the right side
3282 of the diff until it has the content you want in the first commit. Once you
3283 close the editor, your revision will be split into two commits.
3284
3285 [diff editor]:
3286 https://docs.jj-vcs.dev/latest/config/#editing-diffs
3287
3288 By default, the selected changes stay in the original commit, and the
3289 remaining changes go into a new child commit:
3290
3291 ```text
3292 L L'
3293 | |
3294 K (split) => K" (remaining)
3295 | |
3296 J K' (selected)
3297 |
3298 J
3299 ```
3300
3301 With `--parallel/-p`, the two parts become sibling commits instead of
3302 parent and child:
3303
3304 ```text
3305 L'
3306 L / \
3307 | K' | (selected)
3308 K (split) => | K" (remaining)
3309 | \ /
3310 J J
3311 ```
3312
3313 With `-o`, `-A`, or `-B`, the selected changes are extracted into a new
3314 commit at the specified location, while the remaining changes stay in place:
3315
3316 ```text
3317 M M'
3318 | |
3319 L L'
3320 | |
3321 K (split) => K' (remaining, stays here)
3322 | |
3323 J J'
3324 |
3325 K" (selected, inserted before J with -B J)
3326 ```
3327
3328 If the change you split had a description, you will be asked to enter a
3329 change description for each commit. If the change did not have a
3330 description, the second commit will not get a description, and you will be
3331 asked for a description only for the first commit.
3332
3333 Splitting an empty commit is not supported because the same effect can be
3334 achieved with `jj new`.
3335
3336 **Usage:** `jj split [OPTIONS] [FILESETS]...`
3337
3338 ###### **Arguments:**
3339
3340 * `<FILESETS>` — Files matching any of these filesets are put in the selected changes
3341
3342 ###### **Options:**
3343
3344 * `-i`, `--interactive` — Interactively choose which parts to split
3345
3346 This is the default if no filesets are provided.
3347 * `--tool <NAME>` — Specify diff editor to be used (implies --interactive)
3348 * `-r`, `--revision <REVSET>` — The revision to split
3349
3350 Default value: `@`
3351 * `-o`, `--onto <REVSETS>` [alias: `destination`] — The revision(s) to rebase the selected changes onto (can be repeated to create a merge commit)
3352
3353 Extracts the selected changes into a new commit based on the given revision(s). The remaining changes stay in the original commit's location.
3354 * `-A`, `--insert-after <REVSETS>` [alias: `after`] — The revision(s) to insert after (can be repeated to create a merge commit)
3355
3356 Extracts the selected changes into a new commit inserted after the given revision(s). The remaining changes stay in the original commit's location.
3357 * `-B`, `--insert-before <REVSETS>` [alias: `before`] — The revision(s) to insert before (can be repeated to create a merge commit)
3358
3359 Extracts the selected changes into a new commit inserted before the given revision(s). The remaining changes stay in the original commit's location.
3360 * `-m`, `--message <MESSAGE>` — The change description to use for the selected changes (don't open editor)
3361
3362 Sets the description for the revision containing the selected changes. The other revision will keep its original description, if any.
3363 * `--editor` — Open an editor to edit the change description(s)
3364
3365 Forces an editor to open when using `--message` to allow the message to be edited afterward.
3366 * `-p`, `--parallel` — Split the revision into two parallel revisions instead of a parent and child
3367
3368
3369
3370 ## `jj squash`
3371
3372 Move changes from a revision into another revision
3373
3374 Without any options, moves the changes from the working-copy revision to the parent revision.
3375
3376 With the `-r` option, moves the changes from the specified revision to the parent revision. Fails if there are several parent revisions (i.e., the given revision is a merge).
3377
3378 With the `--from` and/or `--into` options, moves changes from/to the given revisions. If either is left out, it defaults to the working-copy commit. For example, `jj squash --into @--` moves changes from the working-copy commit to the grandparent.
3379
3380 If, after moving changes out, the source revision is empty compared to its parent(s), and `--keep-emptied` is not set, it will be abandoned. Without `--interactive` or paths, the source revision will always be empty.
3381
3382 If the source was abandoned and both the source and destination had a non-empty description, you will be asked for the combined description. If either was empty, then the other one will be used.
3383
3384 If a working-copy commit gets abandoned, it will be given a new, empty commit. This is true in general; it is not specific to this command.
3385
3386 The name "squash" comes from the idea of combining (squashing) the changes from multiple revisions together.
3387
3388 EXPERIMENTAL FEATURES
3389
3390 An alternative squashing UI is available via the `-o`, `-A`, and `-B` options. Using any of these options creates a new commit. They can be used together with one or more `--from` options (if no `--from` is specified, `--from @` is assumed).
3391
3392 **Usage:** `jj squash [OPTIONS] [FILESETS]...`
3393
3394 ###### **Arguments:**
3395
3396 * `<FILESETS>` — Move only changes to these paths (instead of all paths)
3397
3398 ###### **Options:**
3399
3400 * `-r`, `--revision <REVSET>` — Revision to squash into its parent (default: @). Incompatible with the experimental `-o`/`-A`/`-B` options
3401 * `-f`, `--from <REVSETS>` — Revision(s) to squash from (default: @)
3402 * `-t`, `--into <REVSET>` [alias: `to`] — Revision to squash into (default: @)
3403 * `-o`, `--onto <REVSETS>` [alias: `destination`] — (Experimental) The revision(s) to use as parent for the new commit (can be repeated to create a merge commit)
3404 * `-A`, `--insert-after <REVSETS>` [alias: `after`] — (Experimental) The revision(s) to insert the new commit after (can be repeated to create a merge commit)
3405 * `-B`, `--insert-before <REVSETS>` [alias: `before`] — (Experimental) The revision(s) to insert the new commit before (can be repeated to create a merge commit)
3406 * `-m`, `--message <MESSAGE>` — The description to use for squashed revision (don't open editor)
3407 * `-u`, `--use-destination-message` — Use the description of the destination revision and discard the description(s) of the source revision(s)
3408 * `--editor` — Open an editor to edit the change description
3409
3410 Forces an editor to open when using `--message` to allow the message to be edited afterwards.
3411 * `-i`, `--interactive` — Interactively choose which parts to squash
3412 * `--tool <NAME>` — Specify diff editor to be used (implies --interactive)
3413 * `-k`, `--keep-emptied` — The source revision will not be abandoned
3414
3415
3416
3417 ## `jj status`
3418
3419 Show high-level repo status [default alias: st]
3420
3421 This includes:
3422
3423 * The working copy commit and its parents, and a summary of the changes in the working copy (compared to the merged parents)
3424
3425 * Conflicts in the working copy
3426
3427 * [Conflicted bookmarks]
3428
3429 Note: You can use `jj diff --summary -r <rev>` to see the changed files for a specific revision.
3430
3431 [Conflicted bookmarks]: https://docs.jj-vcs.dev/latest/bookmarks/#conflicts
3432
3433 **Usage:** `jj status [FILESETS]...`
3434
3435 ###### **Arguments:**
3436
3437 * `<FILESETS>` — Restrict the status display to these paths
3438
3439
3440
3441 ## `jj tag`
3442
3443 Manage tags
3444
3445 **Usage:** `jj tag <COMMAND>`
3446
3447 ###### **Subcommands:**
3448
3449 * `delete` — Delete existing tags
3450 * `list` — List tags and their targets
3451 * `set` — Create or update tags
3452 * `track` — Start tracking given remote tags
3453 * `untrack` — Stop tracking given remote tags
3454
3455
3456
3457 ## `jj tag delete`
3458
3459 Delete existing tags
3460
3461 Revisions referred to by the deleted tags are not abandoned.
3462
3463 **Usage:** `jj tag delete <NAMES>...`
3464
3465 **Command Alias:** `d`
3466
3467 ###### **Arguments:**
3468
3469 * `<NAMES>` — Tag names to delete
3470
3471 By default, the specified pattern matches tag names with glob syntax. You can also use other [string pattern syntax].
3472
3473 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
3474
3475
3476
3477 ## `jj tag list`
3478
3479 List tags and their targets
3480
3481 By default, a tracked remote tag will be included only if its target is different from the local tag. An untracked remote tag won't be listed. For a conflicted tag (both local and remote), old target revisions are preceded by a "-" and new target revisions are preceded by a "+".
3482
3483 The `-r` flag combined with revset expressions can be used for filtering. For example:
3484
3485 * `jj tag list -r 'REV::'` shows tags whose targets are descendants of REV (similar to `git tag --contains REV`).
3486
3487 * `jj tag list -r '::REV'` shows tags whose targets are ancestors of REV (similar to `git tag --merged REV`).
3488
3489 **Usage:** `jj tag list [OPTIONS] [NAMES]...`
3490
3491 **Command Alias:** `l`
3492
3493 ###### **Arguments:**
3494
3495 * `<NAMES>` — Show tags whose local name matches
3496
3497 By default, the specified pattern matches tag names with glob syntax. You can also use other [string pattern syntax].
3498
3499 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
3500
3501 ###### **Options:**
3502
3503 * `-a`, `--all-remotes` — Show all tracked and untracked remote tags including the ones whose targets are synchronized with the local tags
3504 * `--remote <REMOTE>` — Show all tracked and untracked remote tags belonging to this remote
3505
3506 Can be combined with `--tracked` or `--conflicted` to filter the tags shown (can be repeated.)
3507
3508 By default, the specified pattern matches remote names with glob syntax. You can also use other [string pattern syntax].
3509
3510 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
3511 * `-t`, `--tracked` — Show tracked remote tags only
3512
3513 This omits local Git-tracking tags by default.
3514 * `-c`, `--conflicted` — Show conflicted tags only
3515 * `-r`, `--revision <REVSETS>` — Show tags whose local targets are in the given revisions
3516
3517 Note that `-r deleted_tag` will not work since `deleted_tag` wouldn't have a local target.
3518 * `-T`, `--template <TEMPLATE>` — Render each tag using the given template
3519
3520 All 0-argument methods of the [`CommitRef` type] are available as keywords in the template expression. See [`jj help -k templates`] for more information.
3521
3522 The default template can be set by the `templates.tag_list` setting.
3523
3524 [`CommitRef` type]: https://docs.jj-vcs.dev/latest/templates/#commitref-type
3525
3526 [`jj help -k templates`]: https://docs.jj-vcs.dev/latest/templates/
3527 * `--sort <SORT_KEY>` — Sort tags based on the given key (or multiple keys)
3528
3529 Suffix the key with `-` to sort in descending order of the value (e.g. `--sort name-`). Note that when using multiple keys, the first key is the most significant.
3530
3531 This defaults to the `ui.tag-list-sort-keys` setting.
3532
3533 Possible values: `name`, `name-`, `author-name`, `author-name-`, `author-email`, `author-email-`, `author-date`, `author-date-`, `committer-name`, `committer-name-`, `committer-email`, `committer-email-`, `committer-date`, `committer-date-`
3534
3535
3536
3537
3538 ## `jj tag set`
3539
3540 Create or update tags
3541
3542 **Usage:** `jj tag set [OPTIONS] <NAMES>...`
3543
3544 **Command Alias:** `s`
3545
3546 ###### **Arguments:**
3547
3548 * `<NAMES>` — Tag names to create or update
3549
3550 ###### **Options:**
3551
3552 * `-r`, `--revision <REVSET>` [alias: `to`] — Target revision to point to
3553
3554 Default value: `@`
3555 * `--allow-move` — Allow moving existing tags
3556
3557
3558
3559 ## `jj tag track`
3560
3561 Start tracking given remote tags
3562
3563 A tracked remote tag will be imported as a local tag of the same name. Changes to it will propagate to the existing local tag on future pulls.
3564
3565 **Usage:** `jj tag track [OPTIONS] <TAG[@REMOTE]>...`
3566
3567 ###### **Arguments:**
3568
3569 * `<TAG[@REMOTE]>` — Tag name patterns or remote tag symbols to track
3570
3571 `TAG` matches tag names using glob syntax by default. You can also use other [string pattern syntax].
3572
3573 `TAG@REMOTE` resolves to a remote tag exactly.
3574
3575 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
3576
3577 ###### **Options:**
3578
3579 * `--remote <REMOTE>` — Remote names to track
3580
3581 By default, the specified pattern matches remote names with glob syntax. You can also use other [string pattern syntax].
3582
3583 If no remote names are given, all remote tags matching the tag names will be tracked.
3584
3585 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
3586
3587
3588
3589 ## `jj tag untrack`
3590
3591 Stop tracking given remote tags
3592
3593 An untracked remote tag is just a pointer to the last-fetched remote tag. It won't be imported as a local tag on future pulls.
3594
3595 **Usage:** `jj tag untrack [OPTIONS] <TAG[@REMOTE]>...`
3596
3597 ###### **Arguments:**
3598
3599 * `<TAG[@REMOTE]>` — Tag name patterns or remote tag symbols to untrack
3600
3601 `TAG` matches tag names using glob syntax by default. You can also use other [string pattern syntax].
3602
3603 `TAG@REMOTE` resolves to a remote tag exactly.
3604
3605 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
3606
3607 ###### **Options:**
3608
3609 * `--remote <REMOTE>` — Remote names to untrack
3610
3611 By default, the specified pattern matches remote names with glob syntax. You can also use other [string pattern syntax].
3612
3613 If no remote names are given, all remote tags matching the tag names will be untracked.
3614
3615 [string pattern syntax]: https://docs.jj-vcs.dev/latest/revsets/#string-patterns
3616
3617
3618
3619 ## `jj undo`
3620
3621 Undo the last operation
3622
3623 If used once after a normal (non-`undo`) operation, this will undo that last operation by restoring its parent. If `jj undo` is used repeatedly, it will restore increasingly older operations, going further back into the past.
3624
3625 There is also a complementary `jj redo` command that would instead move in the direction of the future after one or more `jj undo`s.
3626
3627 Use `jj op log` to visualize the log of past operations, including a detailed description of any past undo/redo operations. See also `jj op restore` to explicitly restore an older operation by its id (available in the operation log).
3628
3629 **Usage:** `jj undo`
3630
3631
3632
3633 ## `jj unsign`
3634
3635 Drop a cryptographic signature
3636
3637 See also [commit signing] docs.
3638
3639 [commit signing]: https://docs.jj-vcs.dev/latest/config/#commit-signing
3640
3641 **Usage:** `jj unsign [OPTIONS]`
3642
3643 ###### **Options:**
3644
3645 * `-r`, `--revision <REVSETS>` — What revision(s) to unsign
3646
3647
3648
3649 ## `jj util`
3650
3651 Infrequently used commands such as for generating shell completions
3652
3653 **Usage:** `jj util <COMMAND>`
3654
3655 ###### **Subcommands:**
3656
3657 * `backend` — Commands relating to the backend used in the current repo
3658 * `completion` — Print a command-line-completion script
3659 * `config-schema` — Print the JSON schema for the jj TOML config format
3660 * `exec` — Execute an external command via jj
3661 * `gc` — Run backend-dependent garbage collection
3662 * `install-man-pages` — Install Jujutsu's manpages to the provided path
3663 * `markdown-help` — Print the CLI help for all subcommands in Markdown
3664 * `snapshot` — Snapshot the working copy if needed
3665
3666
3667
3668 ## `jj util backend`
3669
3670 Commands relating to the backend used in the current repo
3671
3672 **Usage:** `jj util backend <COMMAND>`
3673
3674 ###### **Subcommands:**
3675
3676 * `name` — Print the name of the backend used in the current repo
3677
3678
3679
3680 ## `jj util backend name`
3681
3682 Print the name of the backend used in the current repo
3683
3684 **Usage:** `jj util backend name`
3685
3686
3687
3688 ## `jj util completion`
3689
3690 Print a command-line-completion script
3691
3692 Apply it by running one of these:
3693
3694 - Bash: `source <(jj util completion bash)`
3695 - Fish: `jj util completion fish | source`
3696 - Nushell:
3697 ```nu
3698 jj util completion nushell | save -f "completions-jj.nu"
3699 use "completions-jj.nu" * # Or `source "completions-jj.nu"`
3700 ```
3701 - Zsh:
3702 ```shell
3703 autoload -U compinit
3704 compinit
3705 source <(jj util completion zsh)
3706 ```
3707
3708 See the docs on [command-line completion] for more details.
3709
3710 [command-line completion]:
3711 https://docs.jj-vcs.dev/latest/install-and-setup/#command-line-completion
3712
3713 **Usage:** `jj util completion <SHELL>`
3714
3715 ###### **Arguments:**
3716
3717 * `<SHELL>`
3718
3719 Possible values: `bash`, `elvish`, `fish`, `nushell`, `power-shell`, `zsh`
3720
3721
3722
3723
3724 ## `jj util config-schema`
3725
3726 Print the JSON schema for the jj TOML config format
3727
3728 **Usage:** `jj util config-schema`
3729
3730
3731
3732 ## `jj util exec`
3733
3734 Execute an external command via jj
3735
3736 This command will have access to the environment variable JJ_WORKSPACE_ROOT.
3737
3738 This is useful for arbitrary aliases.
3739
3740 !! WARNING !!
3741
3742 The following technique just provides a convenient syntax for running
3743 arbitrary code on your system. Using it irresponsibly may cause damage
3744 ranging from breaking the behavior of `jj undo` to wiping your file system.
3745 Exercise the same amount of caution while writing these aliases as you would
3746 when typing commands into the terminal!
3747
3748 This feature may be removed or replaced by an embedded scripting language in
3749 the future.
3750
3751 Let's assume you have a script called "my-jj-script" in your $PATH and you
3752 would like to execute it as "jj my-script". You would add the following line
3753 to your configuration file to achieve that:
3754
3755 ```toml
3756 [aliases]
3757 my-script = ["util", "exec", "--", "my-jj-script"]
3758 # ^^^^
3759 # This makes sure that flags are passed to your script instead of parsed by jj.
3760 ```
3761
3762 If you don't want to manage your script as a separate file, you can even
3763 inline it into your config file:
3764
3765 ```toml
3766 [aliases]
3767 my-inline-script = ["util", "exec", "--", "bash", "-c", """
3768 set -euo pipefail
3769 echo "Look Ma, everything in one file!"
3770 echo "args: $@"
3771 """, ""]
3772 # ^^
3773 # This last empty string will become "$0" in bash, so your actual arguments
3774 # are all included in "$@" and start at "$1" as expected.
3775 ```
3776
3777 > Note: Shebangs (e.g. `#!/usr/bin/env`) aren't necessary since you're
3778 > already explicitly passing your script into the right shell.
3779
3780 **Usage:** `jj util exec <COMMAND> [ARGS]...`
3781
3782 ###### **Arguments:**
3783
3784 * `<COMMAND>` — External command to execute
3785 * `<ARGS>` — Arguments to pass to the external command
3786
3787
3788
3789 ## `jj util gc`
3790
3791 Run backend-dependent garbage collection.
3792
3793 To garbage-collect old operations and the commits/objects referenced by them, run `jj op abandon ..<some old operation>` before `jj util gc`.
3794
3795 **Usage:** `jj util gc [OPTIONS]`
3796
3797 ###### **Options:**
3798
3799 * `--expire <EXPIRE>` — Time threshold
3800
3801 By default, only obsolete objects and operations older than 2 weeks are pruned.
3802
3803 Only the string "now" can be passed to this parameter. Support for arbitrary absolute and relative timestamps will come in a subsequent release.
3804
3805
3806
3807 ## `jj util install-man-pages`
3808
3809 Install Jujutsu's manpages to the provided path
3810
3811 **Usage:** `jj util install-man-pages <PATH>`
3812
3813 ###### **Arguments:**
3814
3815 * `<PATH>` — The path where manpages will installed. An example path might be `/usr/share/man`. The provided path will be appended with `man1`, etc., as appropriate
3816
3817
3818
3819 ## `jj util markdown-help`
3820
3821 Print the CLI help for all subcommands in Markdown
3822
3823 **Usage:** `jj util markdown-help`
3824
3825
3826
3827 ## `jj util snapshot`
3828
3829 Snapshot the working copy if needed
3830
3831 Snapshots the working copy and updates the working-copy commit if the
3832 working copy has changed since the last snapshot. Since almost every command
3833 snapshots the working copy, there is very little reason to run this command
3834 as a human; it is mostly meant for scripts.
3835
3836 If you want to see the ID of the current operation after this command, run
3837 `jj operation log --limit 1`. However, since that command also snapshots the
3838 working copy, there would be no need to run `jj util snapshot` first.
3839
3840 ### Example of programmatic snapshotting
3841
3842 Consider the following:
3843
3844 ```bash
3845 $ echo content > new-file.txt
3846 # At this point, `jj` does not know about `new-file.txt`.
3847 $ ./my-script-that-runs-jj-commands
3848 # Since the script ran `jj` commands, the changes to `new-file.txt` have
3849 # been snapshotted in an operation, which you can see with:
3850 $ jj operation log --patch
3851 ```
3852
3853 If `my-script-that-runs-jj-commands` has a "sandwich" of `jj util snapshot`
3854 at the beginning and end of the script, then the operation that captures
3855 `new-file.txt` will be distinct from the operations created by the `jj`
3856 commands in that script. In addition, the `jj operation log --patch` that
3857 you ran on the command-line after the script would also have its own
3858 operation if needed. However, without `jj util snapshot`, these operations
3859 will be mixed together in the operation log. If this is important to you,
3860 then `jj util snapshot` is useful here to explicitly trigger a snapshot.
3861
3862 ### Checking if the operation ID changed
3863
3864 If you want to compare "before and after" operation IDs, it may be better to
3865 use `jj operation log --no-graph --limit 1 -T id` to query for operation
3866 information, which you can store in a variable in a script. You can then
3867 compare these values as needed to figure out if anything changed during a
3868 `jj` command, such as:
3869
3870 ```bash
3871 start_op_id="$(jj op log -G -n 1 -T id)"
3872 jj git fetch || exit
3873 fetch_op_id="$(jj op log -G -n 1 -T id)"
3874 if [[ "${start_op_id}" == "${fetch_op_id}" ]]; then
3875 # Nothing was fetched.
3876 exit 0
3877 fi
3878 jj rebase -r 'mutable()' -o 'trunk()'
3879 rebase_op_id="$(jj op log -G -n 1 -T id)"
3880 if [[ "${fetch_op_id}" == "${rebase_op_id}" ]]; then
3881 # Nothing was rebased.
3882 exit 0
3883 fi
3884 echo "Fetched and rebased!"
3885 ```
3886
3887 Note that `jj util snapshot` does not output an operation ID, so it is not
3888 suitable for checks such as these.
3889
3890 **Usage:** `jj util snapshot`
3891
3892
3893
3894 ## `jj version`
3895
3896 Display version information
3897
3898 **Usage:** `jj version`
3899
3900
3901
3902 ## `jj workspace`
3903
3904 Commands for working with workspaces
3905
3906 Workspaces let you add additional working copies attached to the same repo. A common use case is so you can run a slow build or test in one workspace while you're continuing to write code in another workspace.
3907
3908 Each workspace has its own working-copy commit. When you have more than one workspace attached to a repo, they are indicated by `<workspace name>@` in `jj log`.
3909
3910 Each workspace also has own sparse patterns.
3911
3912 **Usage:** `jj workspace <COMMAND>`
3913
3914 ###### **Subcommands:**
3915
3916 * `add` — Add a workspace
3917 * `forget` — Stop tracking a workspace's working-copy commit in the repo
3918 * `list` — List workspaces
3919 * `rename` — Renames the current workspace
3920 * `root` — Show the workspace root directory
3921 * `update-stale` — Update a workspace that has become stale
3922
3923
3924
3925 ## `jj workspace add`
3926
3927 Add a workspace
3928
3929 By default, the new workspace inherits the sparse patterns of the current workspace. You can override this with the `--sparse-patterns` option.
3930
3931 **Usage:** `jj workspace add [OPTIONS] <DESTINATION>`
3932
3933 ###### **Arguments:**
3934
3935 * `<DESTINATION>` — Where to create the new workspace
3936
3937 ###### **Options:**
3938
3939 * `--name <NAME>` — A name for the workspace
3940
3941 To override the default, which is the basename of the destination directory.
3942 * `-r`, `--revision <REVSETS>` — A list of parent revisions for the working-copy commit of the newly created workspace. You may specify nothing, or any number of parents.
3943
3944 If no revisions are specified, the new workspace will be created, and its working-copy commit will exist on top of the parent(s) of the working-copy commit in the current workspace, i.e. they will share the same parent(s).
3945
3946 If any revisions are specified, the new workspace will be created, and the new working-copy commit will be created with all these revisions as parents, i.e. the working-copy commit will exist as if you had run `jj new r1 r2 r3 ...`.
3947 * `-m`, `--message <MESSAGE>` — The change description to use
3948 * `--sparse-patterns <SPARSE_PATTERNS>` — How to handle sparse patterns when creating a new workspace
3949
3950 Default value: `copy`
3951
3952 Possible values:
3953 - `copy`:
3954 Copy all sparse patterns from the current workspace
3955 - `full`:
3956 Include all files in the new workspace
3957 - `empty`:
3958 Clear all files from the workspace (it will be empty)
3959
3960
3961
3962
3963 ## `jj workspace forget`
3964
3965 Stop tracking a workspace's working-copy commit in the repo
3966
3967 The workspace will not be touched on disk. It can be deleted from disk before or after running this command.
3968
3969 **Usage:** `jj workspace forget [WORKSPACES]...`
3970
3971 ###### **Arguments:**
3972
3973 * `<WORKSPACES>` — Names of the workspaces to forget. By default, forgets only the current workspace
3974
3975
3976
3977 ## `jj workspace list`
3978
3979 List workspaces
3980
3981 **Usage:** `jj workspace list [OPTIONS]`
3982
3983 ###### **Options:**
3984
3985 * `-T`, `--template <TEMPLATE>` — Render each workspace using the given template
3986
3987 All 0-argument methods of the [`WorkspaceRef` type] are available as keywords in the template expression. See [`jj help -k templates`] for more information.
3988
3989 The default template can be set by the `templates.workspace_list` setting.
3990
3991 [`WorkspaceRef` type]: https://docs.jj-vcs.dev/latest/templates/#workspaceref-type
3992
3993 [`jj help -k templates`]: https://docs.jj-vcs.dev/latest/templates/
3994
3995
3996
3997 ## `jj workspace rename`
3998
3999 Renames the current workspace
4000
4001 **Usage:** `jj workspace rename <NEW_WORKSPACE_NAME>`
4002
4003 ###### **Arguments:**
4004
4005 * `<NEW_WORKSPACE_NAME>` — The name of the workspace to update to
4006
4007
4008
4009 ## `jj workspace root`
4010
4011 Show the workspace root directory
4012
4013 **Usage:** `jj workspace root [OPTIONS]`
4014
4015 ###### **Options:**
4016
4017 * `--name <NAME>` — Name of the workspace (defaults to current)
4018
4019
4020
4021 ## `jj workspace update-stale`
4022
4023 Update a workspace that has become stale
4024
4025 See the [stale working copy documentation] for more information.
4026
4027 [stale working copy documentation]: https://docs.jj-vcs.dev/latest/working-copy/#stale-working-copy
4028
4029 **Usage:** `jj workspace update-stale`
4030
4031
4032
4033 <hr/>
4034
4035 <small><i>
4036 This document was generated automatically by
4037 <a href="https://crates.io/crates/clap-markdown"><code>clap-markdown</code></a>.
4038 </i></small>