just playing with tangled
at gvimdiff 2776 lines 98 kB view raw
1--- 2source: cli/tests/test_generate_md_cli_help.rs 3description: "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<!-- BEGIN MARKDOWN--> 6 7# Command-Line Help for `jj` 8 9This document contains the help content for the `jj` command-line program. 10 11**Command Overview:** 12 13* [`jj`↴](#jj) 14* [`jj abandon`↴](#jj-abandon) 15* [`jj absorb`↴](#jj-absorb) 16* [`jj bookmark`↴](#jj-bookmark) 17* [`jj bookmark create`↴](#jj-bookmark-create) 18* [`jj bookmark delete`↴](#jj-bookmark-delete) 19* [`jj bookmark forget`↴](#jj-bookmark-forget) 20* [`jj bookmark list`↴](#jj-bookmark-list) 21* [`jj bookmark move`↴](#jj-bookmark-move) 22* [`jj bookmark rename`↴](#jj-bookmark-rename) 23* [`jj bookmark set`↴](#jj-bookmark-set) 24* [`jj bookmark track`↴](#jj-bookmark-track) 25* [`jj bookmark untrack`↴](#jj-bookmark-untrack) 26* [`jj commit`↴](#jj-commit) 27* [`jj config`↴](#jj-config) 28* [`jj config edit`↴](#jj-config-edit) 29* [`jj config get`↴](#jj-config-get) 30* [`jj config list`↴](#jj-config-list) 31* [`jj config path`↴](#jj-config-path) 32* [`jj config set`↴](#jj-config-set) 33* [`jj config unset`↴](#jj-config-unset) 34* [`jj describe`↴](#jj-describe) 35* [`jj diff`↴](#jj-diff) 36* [`jj diffedit`↴](#jj-diffedit) 37* [`jj duplicate`↴](#jj-duplicate) 38* [`jj edit`↴](#jj-edit) 39* [`jj evolog`↴](#jj-evolog) 40* [`jj file`↴](#jj-file) 41* [`jj file annotate`↴](#jj-file-annotate) 42* [`jj file chmod`↴](#jj-file-chmod) 43* [`jj file list`↴](#jj-file-list) 44* [`jj file show`↴](#jj-file-show) 45* [`jj file track`↴](#jj-file-track) 46* [`jj file untrack`↴](#jj-file-untrack) 47* [`jj fix`↴](#jj-fix) 48* [`jj git`↴](#jj-git) 49* [`jj git clone`↴](#jj-git-clone) 50* [`jj git export`↴](#jj-git-export) 51* [`jj git fetch`↴](#jj-git-fetch) 52* [`jj git import`↴](#jj-git-import) 53* [`jj git init`↴](#jj-git-init) 54* [`jj git push`↴](#jj-git-push) 55* [`jj git remote`↴](#jj-git-remote) 56* [`jj git remote add`↴](#jj-git-remote-add) 57* [`jj git remote list`↴](#jj-git-remote-list) 58* [`jj git remote remove`↴](#jj-git-remote-remove) 59* [`jj git remote rename`↴](#jj-git-remote-rename) 60* [`jj git remote set-url`↴](#jj-git-remote-set-url) 61* [`jj git root`↴](#jj-git-root) 62* [`jj help`↴](#jj-help) 63* [`jj interdiff`↴](#jj-interdiff) 64* [`jj log`↴](#jj-log) 65* [`jj new`↴](#jj-new) 66* [`jj next`↴](#jj-next) 67* [`jj operation`↴](#jj-operation) 68* [`jj operation abandon`↴](#jj-operation-abandon) 69* [`jj operation diff`↴](#jj-operation-diff) 70* [`jj operation log`↴](#jj-operation-log) 71* [`jj operation restore`↴](#jj-operation-restore) 72* [`jj operation show`↴](#jj-operation-show) 73* [`jj operation undo`↴](#jj-operation-undo) 74* [`jj parallelize`↴](#jj-parallelize) 75* [`jj prev`↴](#jj-prev) 76* [`jj rebase`↴](#jj-rebase) 77* [`jj resolve`↴](#jj-resolve) 78* [`jj restore`↴](#jj-restore) 79* [`jj revert`↴](#jj-revert) 80* [`jj root`↴](#jj-root) 81* [`jj show`↴](#jj-show) 82* [`jj sign`↴](#jj-sign) 83* [`jj simplify-parents`↴](#jj-simplify-parents) 84* [`jj sparse`↴](#jj-sparse) 85* [`jj sparse edit`↴](#jj-sparse-edit) 86* [`jj sparse list`↴](#jj-sparse-list) 87* [`jj sparse reset`↴](#jj-sparse-reset) 88* [`jj sparse set`↴](#jj-sparse-set) 89* [`jj split`↴](#jj-split) 90* [`jj squash`↴](#jj-squash) 91* [`jj status`↴](#jj-status) 92* [`jj tag`↴](#jj-tag) 93* [`jj tag list`↴](#jj-tag-list) 94* [`jj util`↴](#jj-util) 95* [`jj util completion`↴](#jj-util-completion) 96* [`jj util config-schema`↴](#jj-util-config-schema) 97* [`jj util exec`↴](#jj-util-exec) 98* [`jj util gc`↴](#jj-util-gc) 99* [`jj util install-man-pages`↴](#jj-util-install-man-pages) 100* [`jj util markdown-help`↴](#jj-util-markdown-help) 101* [`jj undo`↴](#jj-undo) 102* [`jj unsign`↴](#jj-unsign) 103* [`jj version`↴](#jj-version) 104* [`jj workspace`↴](#jj-workspace) 105* [`jj workspace add`↴](#jj-workspace-add) 106* [`jj workspace forget`↴](#jj-workspace-forget) 107* [`jj workspace list`↴](#jj-workspace-list) 108* [`jj workspace rename`↴](#jj-workspace-rename) 109* [`jj workspace root`↴](#jj-workspace-root) 110* [`jj workspace update-stale`↴](#jj-workspace-update-stale) 111 112## `jj` 113 114Jujutsu (An experimental VCS) 115 116To get started, see the tutorial [`jj help -k tutorial`]. 117 118[`jj help -k tutorial`]: https://jj-vcs.github.io/jj/latest/tutorial/ 119 120**Usage:** `jj [OPTIONS] [COMMAND]` 121 122'jj help --help' lists available keywords. Use 'jj help -k' to show help for one of these keywords. 123 124 125###### **Subcommands:** 126 127* `abandon` — Abandon a revision 128* `absorb` — Move changes from a revision into the stack of mutable revisions 129* `bookmark` — Manage bookmarks [default alias: b] 130* `commit` — Update the description and create a new change on top 131* `config` — Manage config options 132* `describe` — Update the change description or other metadata 133* `diff` — Compare file contents between two revisions 134* `diffedit` — Touch up the content changes in a revision with a diff editor 135* `duplicate` — Create new changes with the same content as existing ones 136* `edit` — Sets the specified revision as the working-copy revision 137* `evolog` — Show how a change has evolved over time 138* `file` — File operations 139* `fix` — Update files with formatting fixes or other changes 140* `git` — Commands for working with Git remotes and the underlying Git repo 141* `help` — Print this message or the help of the given subcommand(s) 142* `interdiff` — Compare the changes of two commits 143* `log` — Show revision history 144* `new` — Create a new, empty change and (by default) edit it in the working copy 145* `next` — Move the working-copy commit to the child revision 146* `operation` — Commands for working with the operation log 147* `parallelize` — Parallelize revisions by making them siblings 148* `prev` — Change the working copy revision relative to the parent revision 149* `rebase` — Move revisions to different parent(s) 150* `resolve` — Resolve conflicted files with an external merge tool 151* `restore` — Restore paths from another revision 152* `revert` — Apply the reverse of the given revision(s) 153* `root` — Show the current workspace root directory (shortcut for `jj workspace root`) 154* `show` — Show commit description and changes in a revision 155* `sign` — Cryptographically sign a revision 156* `simplify-parents` — Simplify parent edges for the specified revision(s) 157* `sparse` — Manage which paths from the working-copy commit are present in the working copy 158* `split` — Split a revision in two 159* `squash` — Move changes from a revision into another revision 160* `status` — Show high-level repo status 161* `tag` — Manage tags 162* `util` — Infrequently used commands such as for generating shell completions 163* `undo` — Undo an operation (shortcut for `jj op undo`) 164* `unsign` — Drop a cryptographic signature 165* `version` — Display version information 166* `workspace` — Commands for working with workspaces 167 168###### **Options:** 169 170* `-R`, `--repository <REPOSITORY>` — Path to repository to operate on 171 172 By default, Jujutsu searches for the closest .jj/ directory in an ancestor of the current working directory. 173* `--ignore-working-copy` — Don't snapshot the working copy, and don't update it 174 175 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. 176 177 Loading the repository at a specific operation with `--at-operation` implies `--ignore-working-copy`. 178* `--ignore-immutable` — Allow rewriting immutable commits 179 180 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. 181 182 This option only affects the check. It does not affect the `immutable_heads()` revset or the `immutable` template keyword. 183* `--at-operation <AT_OPERATION>` — Operation to load the repo at 184 185 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. 186 187 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. 188 189 Use `jj op log` to find the operation ID you want. Any unambiguous prefix of the operation ID is enough. 190 191 When loading the repo at an earlier operation, the working copy will be ignored, as if `--ignore-working-copy` had been specified. 192 193 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. 194* `--debug` — Enable debug logging 195* `--color <WHEN>` — When to colorize output 196 197 Possible values: `always`, `never`, `debug`, `auto` 198 199* `--quiet` — Silence non-primary command output 200 201 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. 202 203 Warnings and errors will still be printed. 204* `--no-pager` — Disable the pager 205* `--config <NAME=VALUE>` — Additional configuration options (can be repeated) 206 207 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. 208* `--config-file <PATH>` — Additional configuration files (can be repeated) 209 210 211 212## `jj abandon` 213 214Abandon a revision 215 216Abandon 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. 217 218If 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. 219 220**Usage:** `jj abandon [OPTIONS] [REVSETS]...` 221 222###### **Arguments:** 223 224* `<REVSETS>` — The revision(s) to abandon (default: @) 225 226###### **Options:** 227 228* `--retain-bookmarks` — Do not delete bookmarks pointing to the revisions to abandon 229 230 Bookmarks will be moved to the parent revisions instead. 231* `--restore-descendants` — Do not modify the content of the children of the abandoned commits 232 233 234 235## `jj absorb` 236 237Move changes from a revision into the stack of mutable revisions 238 239This 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. 240 241The source revision will be abandoned if all changes are absorbed into the destination revisions, and if the source revision has no description. 242 243The modification made by `jj absorb` can be reviewed by `jj op show -p`. 244 245**Usage:** `jj absorb [OPTIONS] [FILESETS]...` 246 247###### **Arguments:** 248 249* `<FILESETS>` — Move only changes to these paths (instead of all paths) 250 251###### **Options:** 252 253* `-f`, `--from <REVSET>` — Source revision to absorb from 254 255 Default value: `@` 256* `-t`, `--into <REVSETS>` — Destination revisions to absorb into 257 258 Only ancestors of the source revision will be considered. 259 260 Default value: `mutable()` 261 262 263 264## `jj bookmark` 265 266Manage bookmarks [default alias: b] 267 268See [`jj help -k bookmarks`] for more information. 269 270[`jj help -k bookmarks`]: https://jj-vcs.github.io/jj/latest/bookmarks 271 272**Usage:** `jj bookmark <COMMAND>` 273 274###### **Subcommands:** 275 276* `create` — Create a new bookmark 277* `delete` — Delete an existing bookmark and propagate the deletion to remotes on the next push 278* `forget` — Forget a bookmark without marking it as a deletion to be pushed 279* `list` — List bookmarks and their targets 280* `move` — Move existing bookmarks to target revision 281* `rename` — Rename `old` bookmark name to `new` bookmark name 282* `set` — Create or update a bookmark to point to a certain commit 283* `track` — Start tracking given remote bookmarks 284* `untrack` — Stop tracking given remote bookmarks 285 286 287 288## `jj bookmark create` 289 290Create a new bookmark 291 292**Usage:** `jj bookmark create [OPTIONS] <NAMES>...` 293 294###### **Arguments:** 295 296* `<NAMES>` — The bookmarks to create 297 298###### **Options:** 299 300* `-r`, `--revision <REVSET>` — The bookmark's target revision 301 302 303 304## `jj bookmark delete` 305 306Delete an existing bookmark and propagate the deletion to remotes on the next push 307 308Revisions 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.) 309 310If you don't want the deletion of the local bookmark to propagate to any tracked remote bookmarks, use `jj bookmark forget` instead. 311 312**Usage:** `jj bookmark delete <NAMES>...` 313 314###### **Arguments:** 315 316* `<NAMES>` — The bookmarks to delete 317 318 By default, the specified name matches exactly. Use `glob:` prefix to select bookmarks by [wildcard pattern]. 319 320 [wildcard pattern]: https://jj-vcs.github.io/jj/latest/revsets/#string-patterns 321 322 323 324## `jj bookmark forget` 325 326Forget a bookmark without marking it as a deletion to be pushed 327 328If 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. 329 330**Usage:** `jj bookmark forget [OPTIONS] <NAMES>...` 331 332###### **Arguments:** 333 334* `<NAMES>` — The bookmarks to forget 335 336 By default, the specified name matches exactly. Use `glob:` prefix to select bookmarks by [wildcard pattern]. 337 338 [wildcard pattern]: https://jj-vcs.github.io/jj/latest/revsets/#string-patterns 339 340###### **Options:** 341 342* `--include-remotes` — When forgetting a local bookmark, also forget any corresponding remote bookmarks 343 344 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. 345 346 347 348## `jj bookmark list` 349 350List bookmarks and their targets 351 352By default, a tracking remote bookmark will be included only if its target is different from the local target. A non-tracking 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 "+". 353 354See [`jj help -k bookmarks`] for more information. 355 356[`jj help -k bookmarks`]: https://jj-vcs.github.io/jj/latest/bookmarks 357 358**Usage:** `jj bookmark list [OPTIONS] [NAMES]...` 359 360###### **Arguments:** 361 362* `<NAMES>` — Show bookmarks whose local name matches 363 364 By default, the specified name matches exactly. Use `glob:` prefix to select bookmarks by [wildcard pattern]. 365 366 [wildcard pattern]: https://jj-vcs.github.io/jj/latest/revsets/#string-patterns 367 368###### **Options:** 369 370* `-a`, `--all-remotes` — Show all tracking and non-tracking remote bookmarks including the ones whose targets are synchronized with the local bookmarks 371* `--remote <REMOTE>` — Show all tracking and non-tracking remote bookmarks belonging to this remote 372 373 Can be combined with `--tracked` or `--conflicted` to filter the bookmarks shown (can be repeated.) 374 375 By default, the specified remote name matches exactly. Use `glob:` prefix to select remotes by [wildcard pattern]. 376 377 [wildcard pattern]: https://jj-vcs.github.io/jj/latest/revsets/#string-patterns 378* `-t`, `--tracked` — Show remote tracked bookmarks only. Omits local Git-tracking bookmarks by default 379* `-c`, `--conflicted` — Show conflicted bookmarks only 380* `-r`, `--revisions <REVSETS>` — Show bookmarks whose local targets are in the given revisions 381 382 Note that `-r deleted_bookmark` will not work since `deleted_bookmark` wouldn't have a local target. 383* `-T`, `--template <TEMPLATE>` — Render each bookmark using the given template 384 385 All 0-argument methods of the [`CommitRef` type] are available as keywords in the template expression. See [`jj help -k templates`] for more information. 386 387 [`CommitRef` type]: https://jj-vcs.github.io/jj/latest/templates/#commitref-type 388 389 [`jj help -k templates`]: https://jj-vcs.github.io/jj/latest/templates/ 390 391 392 393## `jj bookmark move` 394 395Move existing bookmarks to target revision 396 397If bookmark names are given, the specified bookmarks will be updated to point to the target revision. 398 399If `--from` options are given, bookmarks currently pointing to the specified revisions will be updated. The bookmarks can also be filtered by names. 400 401Example: pull up the nearest bookmarks to the working-copy parent 402 403$ jj bookmark move --from 'heads(::@- & bookmarks())' --to @- 404 405**Usage:** `jj bookmark move [OPTIONS] <--from <REVSETS>|NAMES>` 406 407###### **Arguments:** 408 409* `<NAMES>` — Move bookmarks matching the given name patterns 410 411 By default, the specified name matches exactly. Use `glob:` prefix to select bookmarks by [wildcard pattern]. 412 413 [wildcard pattern]: https://jj-vcs.github.io/jj/latest/revsets/#string-patterns 414 415###### **Options:** 416 417* `-f`, `--from <REVSETS>` — Move bookmarks from the given revisions 418* `-t`, `--to <REVSET>` — Move bookmarks to this revision 419* `-B`, `--allow-backwards` — Allow moving bookmarks backwards or sideways 420 421 422 423## `jj bookmark rename` 424 425Rename `old` bookmark name to `new` bookmark name 426 427The new bookmark name points at the same commit as the old bookmark name. 428 429**Usage:** `jj bookmark rename <OLD> <NEW>` 430 431###### **Arguments:** 432 433* `<OLD>` — The old name of the bookmark 434* `<NEW>` — The new name of the bookmark 435 436 437 438## `jj bookmark set` 439 440Create or update a bookmark to point to a certain commit 441 442**Usage:** `jj bookmark set [OPTIONS] <NAMES>...` 443 444###### **Arguments:** 445 446* `<NAMES>` — The bookmarks to update 447 448###### **Options:** 449 450* `-r`, `--revision <REVSET>` — The bookmark's target revision 451* `-B`, `--allow-backwards` — Allow moving the bookmark backwards or sideways 452 453 454 455## `jj bookmark track` 456 457Start tracking given remote bookmarks 458 459A tracking 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. 460 461**Usage:** `jj bookmark track <BOOKMARK@REMOTE>...` 462 463###### **Arguments:** 464 465* `<BOOKMARK@REMOTE>` — Remote bookmarks to track 466 467 By default, the specified name matches exactly. Use `glob:` prefix to select bookmarks by [wildcard pattern]. 468 469 Examples: bookmark@remote, glob:main@*, glob:jjfan-*@upstream 470 471 [wildcard pattern]: https://jj-vcs.github.io/jj/latest/revsets/#string-patterns 472 473 474 475## `jj bookmark untrack` 476 477Stop tracking given remote bookmarks 478 479A non-tracking remote bookmark is just a pointer to the last-fetched remote bookmark. It won't be imported as a local bookmark on future pulls. 480 481If you want to forget a local bookmark while also untracking the corresponding remote bookmarks, use `jj bookmark forget` instead. 482 483**Usage:** `jj bookmark untrack <BOOKMARK@REMOTE>...` 484 485###### **Arguments:** 486 487* `<BOOKMARK@REMOTE>` — Remote bookmarks to untrack 488 489 By default, the specified name matches exactly. Use `glob:` prefix to select bookmarks by [wildcard pattern]. 490 491 Examples: bookmark@remote, glob:main@*, glob:jjfan-*@upstream 492 493 [wildcard pattern]: https://jj-vcs.github.io/jj/latest/revsets/#string-patterns 494 495 496 497## `jj commit` 498 499Update the description and create a new change on top 500 501**Usage:** `jj commit [OPTIONS] [FILESETS]...` 502 503###### **Arguments:** 504 505* `<FILESETS>` — Put these paths in the first commit 506 507###### **Options:** 508 509* `-i`, `--interactive` — Interactively choose which changes to include in the first commit 510* `--tool <NAME>` — Specify diff editor to be used (implies --interactive) 511* `-m`, `--message <MESSAGE>` — The change description to use (don't open editor) 512* `--reset-author` — Reset the author to the configured user 513 514 This resets the author name, email, and timestamp. 515 516 You can use it in combination with the JJ_USER and JJ_EMAIL environment variables to set a different author: 517 518 $ JJ_USER='Foo Bar' JJ_EMAIL=foo@bar.com jj commit --reset-author 519* `--author <AUTHOR>` — Set author to the provided string 520 521 This changes author name and email while retaining author timestamp for non-discardable commits. 522 523 524 525## `jj config` 526 527Manage config options 528 529Operates on jj configuration, which comes from the config file and environment variables. 530 531See [`jj help -k config`] to know more about file locations, supported config options, and other details about `jj config`. 532 533[`jj help -k config`]: https://jj-vcs.github.io/jj/latest/config/ 534 535**Usage:** `jj config <COMMAND>` 536 537###### **Subcommands:** 538 539* `edit` — Start an editor on a jj config file 540* `get` — Get the value of a given config option. 541* `list` — List variables set in config files, along with their values 542* `path` — Print the paths to the config files 543* `set` — Update a config file to set the given option to a given value 544* `unset` — Update a config file to unset the given option 545 546 547 548## `jj config edit` 549 550Start an editor on a jj config file. 551 552Creates the file if it doesn't already exist regardless of what the editor does. 553 554**Usage:** `jj config edit <--user|--repo>` 555 556###### **Options:** 557 558* `--user` — Target the user-level config 559* `--repo` — Target the repo-level config 560 561 562 563## `jj config get` 564 565Get the value of a given config option. 566 567Unlike `jj config list`, the result of `jj config get` is printed without 568extra formatting and therefore is usable in scripting. For example: 569 570$ jj config list user.name 571user.name="Martin von Zweigbergk" 572$ jj config get user.name 573Martin von Zweigbergk 574 575**Usage:** `jj config get <NAME>` 576 577###### **Arguments:** 578 579* `<NAME>` 580 581 582 583## `jj config list` 584 585List variables set in config files, along with their values 586 587**Usage:** `jj config list [OPTIONS] [NAME]` 588 589###### **Arguments:** 590 591* `<NAME>` — An optional name of a specific config option to look up 592 593###### **Options:** 594 595* `--include-defaults` — Whether to explicitly include built-in default values in the list 596* `--include-overridden` — Allow printing overridden values 597* `--user` — Target the user-level config 598* `--repo` — Target the repo-level config 599* `-T`, `--template <TEMPLATE>` — Render each variable using the given template 600 601 The following keywords are available in the template expression: 602 603 * `name: String`: Config name. 604 * `value: ConfigValue`: Value to be formatted in TOML syntax. 605 * `overridden: Boolean`: True if the value is shadowed by other. 606 * `source: String`: Source of the value. 607 * `path: String`: Path to the config file. 608 609 Can be overridden by the `templates.config_list` setting. To 610 see a detailed config list, use the `builtin_config_list_detailed` 611 template. 612 613 See [`jj help -k templates`] for more information. 614 615 [`jj help -k templates`]: 616 https://jj-vcs.github.io/jj/latest/templates/ 617 618 619 620## `jj config path` 621 622Print the paths to the config files 623 624A config file at that path may or may not exist. 625 626See `jj config edit` if you'd like to immediately edit a file. 627 628**Usage:** `jj config path <--user|--repo>` 629 630###### **Options:** 631 632* `--user` — Target the user-level config 633* `--repo` — Target the repo-level config 634 635 636 637## `jj config set` 638 639Update a config file to set the given option to a given value 640 641**Usage:** `jj config set <--user|--repo> <NAME> <VALUE>` 642 643###### **Arguments:** 644 645* `<NAME>` 646* `<VALUE>` — New value to set 647 648 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. 649 650 Alternative, e.g. to avoid dealing with shell quoting, use `jj config edit` to edit the TOML file directly. 651 652###### **Options:** 653 654* `--user` — Target the user-level config 655* `--repo` — Target the repo-level config 656 657 658 659## `jj config unset` 660 661Update a config file to unset the given option 662 663**Usage:** `jj config unset <--user|--repo> <NAME>` 664 665###### **Arguments:** 666 667* `<NAME>` 668 669###### **Options:** 670 671* `--user` — Target the user-level config 672* `--repo` — Target the repo-level config 673 674 675 676## `jj describe` 677 678Update the change description or other metadata 679 680Starts an editor to let you edit the description of changes. The editor will be $EDITOR, or `pico` if that's not defined (`Notepad` on Windows). 681 682**Usage:** `jj describe [OPTIONS] [REVSETS]...` 683 684###### **Arguments:** 685 686* `<REVSETS>` — The revision(s) whose description to edit (default: @) 687 688###### **Options:** 689 690* `-m`, `--message <MESSAGE>` — The change description to use (don't open editor) 691 692 If multiple revisions are specified, the same description will be used for all of them. 693* `--stdin` — Read the change description from stdin 694 695 If multiple revisions are specified, the same description will be used for all of them. 696* `--no-edit` — Don't open an editor 697 698 This is mainly useful in combination with e.g. `--reset-author`. 699* `--edit` — Open an editor 700 701 Forces an editor to open when using `--stdin` or `--message` to allow the message to be edited afterwards. 702* `--reset-author` — Reset the author to the configured user 703 704 This resets the author name, email, and timestamp. 705 706 You can use it in combination with the JJ_USER and JJ_EMAIL environment variables to set a different author: 707 708 $ JJ_USER='Foo Bar' JJ_EMAIL=foo@bar.com jj describe --reset-author 709* `--author <AUTHOR>` — Set author to the provided string 710 711 This changes author name and email while retaining author timestamp for non-discardable commits. 712 713 714 715## `jj diff` 716 717Compare file contents between two revisions 718 719With the `-r` option, which is the default, 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. 720 721With 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. 722 723**Usage:** `jj diff [OPTIONS] [FILESETS]...` 724 725###### **Arguments:** 726 727* `<FILESETS>` — Restrict the diff to these paths 728 729###### **Options:** 730 731* `-r`, `--revisions <REVSETS>` — Show changes in these revisions 732 733 If there are multiple revisions, then then 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). 734 735 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. 736* `-f`, `--from <REVSET>` — Show changes from this revision 737* `-t`, `--to <REVSET>` — Show changes to this revision 738* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted 739* `--stat` — Show a histogram of the changes 740* `--types` — For each path, show only its type before and after 741 742 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. 743* `--name-only` — For each path, show only its path 744 745 Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g` 746* `--git` — Show a Git-format diff 747* `--color-words` — Show a word-level diff with changes indicated only by color 748* `--tool <TOOL>` — Generate diff by external command 749* `--context <CONTEXT>` — Number of lines of context to show 750* `-w`, `--ignore-all-space` — Ignore whitespace when comparing lines 751* `-b`, `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines 752 753 754 755## `jj diffedit` 756 757Touch up the content changes in a revision with a diff editor 758 759With the `-r` option, which is the default, starts a [diff editor] on the changes in the revision. 760 761With the `--from` and/or `--to` options, starts a [diff editor] comparing the "from" revision to the "to" revision. 762 763[diff editor]: https://jj-vcs.github.io/jj/latest/config/#editing-diffs 764 765Edit 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. 766 767See `jj restore` if you want to move entire files from one revision to another. For moving changes between revisions, see `jj squash -i`. 768 769**Usage:** `jj diffedit [OPTIONS]` 770 771###### **Options:** 772 773* `-r`, `--revision <REVSET>` — The revision to touch up 774 775 Defaults to @ if neither --to nor --from are specified. 776* `-f`, `--from <REVSET>` — Show changes from this revision 777 778 Defaults to @ if --to is specified. 779* `-t`, `--to <REVSET>` — Edit changes in this revision 780 781 Defaults to @ if --from is specified. 782* `--tool <NAME>` — Specify diff editor to be used 783* `--restore-descendants` — Preserve the content (not the diff) when rebasing descendants 784 785 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. 786 787 788 789## `jj duplicate` 790 791Create new changes with the same content as existing ones 792 793When none of the `--destination`, `--insert-after`, or `--insert-before` arguments are provided, commits will be duplicated onto their existing parents or onto other newly duplicated commits. 794 795When any of the `--destination`, `--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. 796 797**Usage:** `jj duplicate [OPTIONS] [REVSETS]...` 798 799###### **Arguments:** 800 801* `<REVSETS>` — The revision(s) to duplicate (default: @) 802 803###### **Options:** 804 805* `-d`, `--destination <REVSETS>` — The revision(s) to duplicate onto (can be repeated to create a merge commit) 806* `-A`, `--insert-after <REVSETS>` — The revision(s) to insert after (can be repeated to create a merge commit) 807* `-B`, `--insert-before <REVSETS>` — The revision(s) to insert before (can be repeated to create a merge commit) 808 809 810 811## `jj edit` 812 813Sets the specified revision as the working-copy revision 814 815Note: it is [generally recommended] to instead use `jj new` and `jj squash`. 816 817[generally recommended]: https://jj-vcs.github.io/jj/latest/FAQ#how-do-i-resume-working-on-an-existing-change 818 819**Usage:** `jj edit <REVSET>` 820 821###### **Arguments:** 822 823* `<REVSET>` — The commit to edit 824 825 826 827## `jj evolog` 828 829Show how a change has evolved over time 830 831Lists the previous commits which a change has pointed to. The current commit of a change evolves when the change is updated, rebased, etc. 832 833**Usage:** `jj evolog [OPTIONS]` 834 835###### **Options:** 836 837* `-r`, `--revision <REVSET>` 838 839 Default value: `@` 840* `-n`, `--limit <LIMIT>` — Limit number of revisions to show 841 842 Applied after revisions are reordered topologically, but before being reversed. 843* `--reversed` — Show revisions in the opposite order (older revisions first) 844* `--no-graph` — Don't show the graph, show a flat list of revisions 845* `-T`, `--template <TEMPLATE>` — Render each revision using the given template 846 847 Run `jj log -T` to list the built-in templates. 848 849 You can also specify arbitrary template expressions using the [built-in keywords]. See [`jj help -k templates`] for more information. 850 851 [built-in keywords]: https://jj-vcs.github.io/jj/latest/templates/#commit-keywords 852 853 [`jj help -k templates`]: https://jj-vcs.github.io/jj/latest/templates/ 854* `-p`, `--patch` — Show patch compared to the previous version of this change 855 856 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. 857* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted 858* `--stat` — Show a histogram of the changes 859* `--types` — For each path, show only its type before and after 860 861 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. 862* `--name-only` — For each path, show only its path 863 864 Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g` 865* `--git` — Show a Git-format diff 866* `--color-words` — Show a word-level diff with changes indicated only by color 867* `--tool <TOOL>` — Generate diff by external command 868* `--context <CONTEXT>` — Number of lines of context to show 869* `--ignore-all-space` — Ignore whitespace when comparing lines 870* `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines 871 872 873 874## `jj file` 875 876File operations 877 878**Usage:** `jj file <COMMAND>` 879 880###### **Subcommands:** 881 882* `annotate` — Show the source change for each line of the target file 883* `chmod` — Sets or removes the executable bit for paths in the repo 884* `list` — List files in a revision 885* `show` — Print contents of files in a revision 886* `track` — Start tracking specified paths in the working copy 887* `untrack` — Stop tracking specified paths in the working copy 888 889 890 891## `jj file annotate` 892 893Show the source change for each line of the target file. 894 895Annotates 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. 896 897**Usage:** `jj file annotate [OPTIONS] <PATH>` 898 899###### **Arguments:** 900 901* `<PATH>` — the file to annotate 902 903###### **Options:** 904 905* `-r`, `--revision <REVSET>` — an optional revision to start at 906* `-T`, `--template <TEMPLATE>` — Render each line using the given template 907 908 All 0-argument methods of the [`AnnotationLine` type] are available as keywords in the template expression. See [`jj help -k templates`] for more information. 909 910 If not specified, this defaults to the `templates.file_annotate` setting. 911 912 [`AnnotationLine` type]: https://jj-vcs.github.io/jj/latest/templates/#annotationline-type 913 914 [`jj help -k templates`]: https://jj-vcs.github.io/jj/latest/templates/ 915 916 917 918## `jj file chmod` 919 920Sets or removes the executable bit for paths in the repo 921 922Unlike the POSIX `chmod`, `jj file chmod` also works on Windows, on conflicted files, and on arbitrary revisions. 923 924**Usage:** `jj file chmod [OPTIONS] <MODE> <FILESETS>...` 925 926###### **Arguments:** 927 928* `<MODE>` 929 930 Possible values: 931 - `n`: 932 Make a path non-executable (alias: normal) 933 - `x`: 934 Make a path executable (alias: executable) 935 936* `<FILESETS>` — Paths to change the executable bit for 937 938###### **Options:** 939 940* `-r`, `--revision <REVSET>` — The revision to update 941 942 Default value: `@` 943 944 945 946## `jj file list` 947 948List files in a revision 949 950**Usage:** `jj file list [OPTIONS] [FILESETS]...` 951 952###### **Arguments:** 953 954* `<FILESETS>` — Only list files matching these prefixes (instead of all files) 955 956###### **Options:** 957 958* `-r`, `--revision <REVSET>` — The revision to list files in 959 960 Default value: `@` 961* `-T`, `--template <TEMPLATE>` — Render each file entry using the given template 962 963 All 0-argument methods of the [`TreeEntry` type] are available as keywords in the template expression. See [`jj help -k templates`] for more information. 964 965 [`TreeEntry` type]: https://jj-vcs.github.io/jj/latest/templates/#treeentry-type 966 967 [`jj help -k templates`]: https://jj-vcs.github.io/jj/latest/templates/ 968 969 970 971## `jj file show` 972 973Print contents of files in a revision 974 975If the given path is a directory, files in the directory will be visited recursively. 976 977**Usage:** `jj file show [OPTIONS] <FILESETS>...` 978 979###### **Arguments:** 980 981* `<FILESETS>` — Paths to print 982 983###### **Options:** 984 985* `-r`, `--revision <REVSET>` — The revision to get the file contents from 986 987 Default value: `@` 988 989 990 991## `jj file track` 992 993Start tracking specified paths in the working copy 994 995Without arguments, all paths that are not ignored will be tracked. 996 997New files in the working copy can be automatically tracked. 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()` and this command has no effect. 998 999**Usage:** `jj file track <FILESETS>...` 1000 1001###### **Arguments:** 1002 1003* `<FILESETS>` — Paths to track 1004 1005 1006 1007## `jj file untrack` 1008 1009Stop tracking specified paths in the working copy 1010 1011**Usage:** `jj file untrack <FILESETS>...` 1012 1013###### **Arguments:** 1014 1015* `<FILESETS>` — Paths to untrack. They must already be ignored. 1016 1017 The paths could be ignored via a .gitignore or .git/info/exclude (in colocated repos). 1018 1019 1020 1021## `jj fix` 1022 1023Update files with formatting fixes or other changes 1024 1025The primary use case for this command is to apply the results of automatic 1026code formatting tools to revisions that may not be properly formatted yet. 1027It can also be used to modify files with other tools like `sed` or `sort`. 1028 1029The changed files in the given revisions will be updated with any fixes 1030determined by passing their file content through any external tools the user 1031has configured for those files. Descendants will also be updated by passing 1032their versions of the same files through the same tools, which will ensure 1033that the fixes are not lost. This will never result in new conflicts. Files 1034with existing conflicts will be updated on all sides of the conflict, which 1035can potentially increase or decrease the number of conflict markers. 1036 1037The external tools must accept the current file content on standard input, 1038and return the updated file content on standard output. A tool's output will 1039not be used unless it exits with a successful exit code. Output on standard 1040error will be passed through to the terminal. 1041 1042Tools are defined in a table where the keys are arbitrary identifiers and 1043the values have the following properties: 1044 - `command`: The arguments used to run the tool. The first argument is the 1045 path to an executable file. Arguments can contain the substring `$path`, 1046 which will be replaced with the repo-relative path of the file being 1047 fixed. It is useful to provide the path to tools that include the path in 1048 error messages, or behave differently based on the directory or file 1049 name. 1050 - `patterns`: Determines which files the tool will affect. If this list is 1051 empty, no files will be affected by the tool. If there are multiple 1052 patterns, the tool is applied only once to each file in the union of the 1053 patterns. 1054 - `enabled`: Enables or disables the tool. If omitted, the tool is enabled. 1055 This is useful for defining disabled tools in user configuration that can 1056 be enabled in individual repositories with one config setting. 1057 1058For example, the following configuration defines how two code formatters 1059(`clang-format` and `black`) will apply to three different file extensions 1060(`.cc`, `.h`, and `.py`): 1061 1062```toml 1063[fix.tools.clang-format] 1064command = ["/usr/bin/clang-format", "--assume-filename=$path"] 1065patterns = ["glob:'**/*.cc'", 1066 "glob:'**/*.h'"] 1067 1068[fix.tools.black] 1069command = ["/usr/bin/black", "-", "--stdin-filename=$path"] 1070patterns = ["glob:'**/*.py'"] 1071``` 1072 1073Execution order of tools that affect the same file is deterministic, but 1074currently unspecified, and may change between releases. If two tools affect 1075the same file, the second tool to run will receive its input from the 1076output of the first tool. 1077 1078**Usage:** `jj fix [OPTIONS] [FILESETS]...` 1079 1080###### **Arguments:** 1081 1082* `<FILESETS>` — Fix only these paths 1083 1084###### **Options:** 1085 1086* `-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 1087* `--include-unchanged-files` — Fix unchanged files in addition to changed ones. If no paths are specified, all files in the repo will be fixed 1088 1089 1090 1091## `jj git` 1092 1093Commands for working with Git remotes and the underlying Git repo 1094 1095See this [comparison], including a [table of commands]. 1096 1097[comparison]: https://jj-vcs.github.io/jj/latest/git-comparison/. 1098 1099[table of commands]: https://jj-vcs.github.io/jj/latest/git-command-table 1100 1101**Usage:** `jj git <COMMAND>` 1102 1103###### **Subcommands:** 1104 1105* `clone` — Create a new repo backed by a clone of a Git repo 1106* `export` — Update the underlying Git repo with changes made in the repo 1107* `fetch` — Fetch from a Git remote 1108* `import` — Update repo with changes made in the underlying Git repo 1109* `init` — Create a new Git backed repo 1110* `push` — Push to a Git remote 1111* `remote` — Manage Git remotes 1112* `root` — Show the underlying Git directory of a repository using the Git backend 1113 1114 1115 1116## `jj git clone` 1117 1118Create a new repo backed by a clone of a Git repo 1119 1120The Git repo will be a bare git repo stored inside the `.jj/` directory. 1121 1122**Usage:** `jj git clone [OPTIONS] <SOURCE> [DESTINATION]` 1123 1124###### **Arguments:** 1125 1126* `<SOURCE>` — URL or path of the Git repo to clone 1127 1128 Local path will be resolved to absolute form. 1129* `<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 1130 1131###### **Options:** 1132 1133* `--remote <REMOTE_NAME>` — Name of the newly created remote 1134 1135 Default value: `origin` 1136* `--colocate` — Whether or not to colocate the Jujutsu repo with the git repo 1137* `--depth <DEPTH>` — Create a shallow clone of the given depth 1138 1139 1140 1141## `jj git export` 1142 1143Update the underlying Git repo with changes made in the repo 1144 1145**Usage:** `jj git export` 1146 1147 1148 1149## `jj git fetch` 1150 1151Fetch from a Git remote 1152 1153If 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. 1154 1155**Usage:** `jj git fetch [OPTIONS]` 1156 1157###### **Options:** 1158 1159* `-b`, `--branch <BRANCH>` — Fetch only some of the branches 1160 1161 By default, the specified name matches exactly. Use `glob:` prefix to expand `*` as a glob, e.g. `--branch 'glob:push-*'`. Other wildcard characters such as `?` are *not* supported. 1162 1163 Default value: `glob:*` 1164* `--remote <REMOTE>` — The remote to fetch from (only named remotes are supported, can be repeated) 1165 1166 This defaults to the `git.fetch` setting. If that is not configured, and if there are multiple remotes, the remote named "origin" will be used. 1167 1168 By default, the specified remote names matches exactly. Use a [string pattern], e.g. `--remote 'glob:*'`, to select remotes using patterns. 1169 1170 [string pattern]: https://jj-vcs.github.io/jj/latest/revsets#string-patterns 1171* `--all-remotes` — Fetch from all remotes 1172 1173 1174 1175## `jj git import` 1176 1177Update repo with changes made in the underlying Git repo 1178 1179If 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. 1180 1181**Usage:** `jj git import` 1182 1183 1184 1185## `jj git init` 1186 1187Create a new Git backed repo 1188 1189**Usage:** `jj git init [OPTIONS] [DESTINATION]` 1190 1191###### **Arguments:** 1192 1193* `<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. 1194 1195 By default the `git` repo is under `$destination/.jj` 1196 1197 Default value: `.` 1198 1199###### **Options:** 1200 1201* `--colocate` — 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. 1202 1203 This is done by placing the backing git repo into a `.git` directory in the root of the `jj` repo along with the `.jj` directory. If the `.git` directory already exists, all the existing commits will be imported. 1204 1205 This option is mutually exclusive with `--git-repo`. 1206* `--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. 1207 1208 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 co-located repo. 1209 1210 This option is mutually exclusive with `--colocate`. 1211 1212 1213 1214## `jj git push` 1215 1216Push to a Git remote 1217 1218By default, pushes tracking bookmarks pointing to `remote_bookmarks(remote=<remote>)..@`. Use `--bookmark` to push specific bookmarks. Use `--all` to push all bookmarks. Use `--change` to generate bookmark names based on the change IDs of specific commits. 1219 1220Unlike 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. 1221 1222Before 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]. 1223 1224[safety checks]: https://jj-vcs.github.io/jj/latest/bookmarks/#pushing-bookmarks-safety-checks 1225 1226[bookmark conflicts]: https://jj-vcs.github.io/jj/latest/bookmarks/#conflicts 1227 1228**Usage:** `jj git push [OPTIONS]` 1229 1230###### **Options:** 1231 1232* `--remote <REMOTE>` — The remote to push to (only named remotes are supported) 1233 1234 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. 1235* `-b`, `--bookmark <BOOKMARK>` — Push only this bookmark, or bookmarks matching a pattern (can be repeated) 1236 1237 By default, the specified name matches exactly. Use `glob:` prefix to select bookmarks by [wildcard pattern]. 1238 1239 [wildcard pattern]: https://jj-vcs.github.io/jj/latest/revsets#string-patterns 1240* `--all` — Push all bookmarks (including new bookmarks) 1241* `--tracked` — Push all tracked bookmarks 1242 1243 This usually means that the bookmark was already pushed to or fetched from the [relevant remote]. 1244 1245 [relevant remote]: https://jj-vcs.github.io/jj/latest/bookmarks#remotes-and-tracked-bookmarks 1246* `--deleted` — Push all deleted bookmarks 1247 1248 Only tracked bookmarks can be successfully deleted on the remote. A warning will be printed if any untracked bookmarks on the remote correspond to missing local bookmarks. 1249* `-N`, `--allow-new` — Allow pushing new bookmarks 1250 1251 Newly-created remote bookmarks will be tracked automatically. 1252 1253 This can also be turned on by the `git.push-new-bookmarks` setting. If it's set to `true`, `--allow-new` is no-op. 1254* `--allow-empty-description` — Allow pushing commits with empty descriptions 1255* `--allow-private` — Allow pushing commits that are private 1256 1257 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. 1258* `-r`, `--revisions <REVSETS>` — Push bookmarks pointing to these commits (can be repeated) 1259* `-c`, `--change <REVSETS>` — Push this commit by creating a bookmark based on its change ID (can be repeated) 1260 1261 The created bookmark will be tracked automatically. Use the `git.push-bookmark-prefix` setting to change the prefix for generated names. 1262* `--named <NAME=REVISION>` — Specify a new bookmark name and a revision to push under that name, e.g. '--named myfeature=@' 1263 1264 Does not require --allow-new. 1265* `--dry-run` — Only display what will change on the remote 1266 1267 1268 1269## `jj git remote` 1270 1271Manage Git remotes 1272 1273The Git repo will be a bare git repo stored inside the `.jj/` directory. 1274 1275**Usage:** `jj git remote <COMMAND>` 1276 1277###### **Subcommands:** 1278 1279* `add` — Add a Git remote 1280* `list` — List Git remotes 1281* `remove` — Remove a Git remote and forget its bookmarks 1282* `rename` — Rename a Git remote 1283* `set-url` — Set the URL of a Git remote 1284 1285 1286 1287## `jj git remote add` 1288 1289Add a Git remote 1290 1291**Usage:** `jj git remote add <REMOTE> <URL>` 1292 1293###### **Arguments:** 1294 1295* `<REMOTE>` — The remote's name 1296* `<URL>` — The remote's URL or path 1297 1298 Local path will be resolved to absolute form. 1299 1300 1301 1302## `jj git remote list` 1303 1304List Git remotes 1305 1306**Usage:** `jj git remote list` 1307 1308 1309 1310## `jj git remote remove` 1311 1312Remove a Git remote and forget its bookmarks 1313 1314**Usage:** `jj git remote remove <REMOTE>` 1315 1316###### **Arguments:** 1317 1318* `<REMOTE>` — The remote's name 1319 1320 1321 1322## `jj git remote rename` 1323 1324Rename a Git remote 1325 1326**Usage:** `jj git remote rename <OLD> <NEW>` 1327 1328###### **Arguments:** 1329 1330* `<OLD>` — The name of an existing remote 1331* `<NEW>` — The desired name for `old` 1332 1333 1334 1335## `jj git remote set-url` 1336 1337Set the URL of a Git remote 1338 1339**Usage:** `jj git remote set-url <REMOTE> <URL>` 1340 1341###### **Arguments:** 1342 1343* `<REMOTE>` — The remote's name 1344* `<URL>` — The desired URL or path for `remote` 1345 1346 Local path will be resolved to absolute form. 1347 1348 1349 1350## `jj git root` 1351 1352Show the underlying Git directory of a repository using the Git backend 1353 1354**Usage:** `jj git root` 1355 1356 1357 1358## `jj help` 1359 1360Print this message or the help of the given subcommand(s) 1361 1362**Usage:** `jj help [OPTIONS] [COMMAND]...` 1363 1364###### **Arguments:** 1365 1366* `<COMMAND>` — Print help for the subcommand(s) 1367 1368###### **Options:** 1369 1370* `-k`, `--keyword <KEYWORD>` — Show help for keywords instead of commands 1371 1372 Possible values: 1373 - `bookmarks`: 1374 Named pointers to revisions (similar to Git's branches) 1375 - `config`: 1376 How and where to set configuration options 1377 - `filesets`: 1378 A functional language for selecting a set of files 1379 - `glossary`: 1380 Definitions of various terms 1381 - `revsets`: 1382 A functional language for selecting a set of revision 1383 - `templates`: 1384 A functional language to customize command output 1385 - `tutorial`: 1386 Show a tutorial to get started with jj 1387 1388 1389 1390 1391## `jj interdiff` 1392 1393Compare the changes of two commits 1394 1395This excludes changes from other commits by temporarily rebasing `--from` onto `--to`'s parents. If you wish to compare the same change across versions, consider `jj evolog -p` instead. 1396 1397**Usage:** `jj interdiff [OPTIONS] <--from <REVSET>|--to <REVSET>> [FILESETS]...` 1398 1399###### **Arguments:** 1400 1401* `<FILESETS>` — Restrict the diff to these paths 1402 1403###### **Options:** 1404 1405* `-f`, `--from <REVSET>` — Show changes from this revision 1406* `-t`, `--to <REVSET>` — Show changes to this revision 1407* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted 1408* `--stat` — Show a histogram of the changes 1409* `--types` — For each path, show only its type before and after 1410 1411 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. 1412* `--name-only` — For each path, show only its path 1413 1414 Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g` 1415* `--git` — Show a Git-format diff 1416* `--color-words` — Show a word-level diff with changes indicated only by color 1417* `--tool <TOOL>` — Generate diff by external command 1418* `--context <CONTEXT>` — Number of lines of context to show 1419* `-w`, `--ignore-all-space` — Ignore whitespace when comparing lines 1420* `-b`, `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines 1421 1422 1423 1424## `jj log` 1425 1426Show revision history 1427 1428Renders 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. 1429 1430[`jj help -k revsets`]: https://jj-vcs.github.io/jj/latest/revsets/ 1431 1432Spans of revisions that are not included in the graph per `--revisions` are rendered as a synthetic node labeled "(elided revisions)". 1433 1434The 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]. 1435 1436[Immutable revisions]: https://jj-vcs.github.io/jj/latest/config/#set-of-immutable-commits 1437 1438[customized]: https://jj-vcs.github.io/jj/latest/config/#node-style 1439 1440**Usage:** `jj log [OPTIONS] [FILESETS]...` 1441 1442###### **Arguments:** 1443 1444* `<FILESETS>` — Show revisions modifying the given paths 1445 1446###### **Options:** 1447 1448* `-r`, `--revisions <REVSETS>` — Which revisions to show 1449 1450 If no paths nor revisions are specified, this defaults to the `revsets.log` setting. 1451* `-n`, `--limit <LIMIT>` — Limit number of revisions to show 1452 1453 Applied after revisions are filtered and reordered topologically, but before being reversed. 1454* `--reversed` — Show revisions in the opposite order (older revisions first) 1455* `--no-graph` — Don't show the graph, show a flat list of revisions 1456* `-T`, `--template <TEMPLATE>` — Render each revision using the given template 1457 1458 Run `jj log -T` to list the built-in templates. 1459 1460 You can also specify arbitrary template expressions using the [built-in keywords]. See [`jj help -k templates`] for more information. 1461 1462 If not specified, this defaults to the `templates.log` setting. 1463 1464 [built-in keywords]: https://jj-vcs.github.io/jj/latest/templates/#commit-keywords 1465 1466 [`jj help -k templates`]: https://jj-vcs.github.io/jj/latest/templates/ 1467* `-p`, `--patch` — Show patch 1468* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted 1469* `--stat` — Show a histogram of the changes 1470* `--types` — For each path, show only its type before and after 1471 1472 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. 1473* `--name-only` — For each path, show only its path 1474 1475 Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g` 1476* `--git` — Show a Git-format diff 1477* `--color-words` — Show a word-level diff with changes indicated only by color 1478* `--tool <TOOL>` — Generate diff by external command 1479* `--context <CONTEXT>` — Number of lines of context to show 1480* `--ignore-all-space` — Ignore whitespace when comparing lines 1481* `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines 1482 1483 1484 1485## `jj new` 1486 1487Create a new, empty change and (by default) edit it in the working copy 1488 1489By default, `jj` will edit the new change, making the [working copy] represent the new commit. This can be avoided with `--no-edit`. 1490 1491Note 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. 1492 1493[working copy]: https://jj-vcs.github.io/jj/latest/working-copy/ 1494 1495**Usage:** `jj new [OPTIONS] [REVSETS]...` 1496 1497###### **Arguments:** 1498 1499* `<REVSETS>` — Parent(s) of the new change 1500 1501 Default value: `@` 1502 1503###### **Options:** 1504 1505* `-m`, `--message <MESSAGE>` — The change description to use 1506* `--no-edit` — Do not edit the newly created change 1507* `-A`, `--insert-after <REVSETS>` — Insert the new change after the given commit(s) 1508* `-B`, `--insert-before <REVSETS>` — Insert the new change before the given commit(s) 1509 1510 1511 1512## `jj next` 1513 1514Move the working-copy commit to the child revision 1515 1516The command creates a new empty working copy revision that is the child of a 1517descendant `offset` revisions ahead of the parent of the current working 1518copy. 1519 1520For example, when the offset is 1: 1521 1522```text 1523D D @ 1524| |/ 1525C @ => C 1526|/ | 1527B B 1528``` 1529 1530If `--edit` is passed, the working copy revision is changed to the child of 1531the current working copy revision. 1532 1533```text 1534D D 1535| | 1536C C 1537| | 1538B => @ 1539| | 1540@ A 1541``` 1542 1543**Usage:** `jj next [OPTIONS] [OFFSET]` 1544 1545###### **Arguments:** 1546 1547* `<OFFSET>` — How many revisions to move forward. Advances to the next child by default 1548 1549 Default value: `1` 1550 1551###### **Options:** 1552 1553* `-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`) 1554 1555 Takes precedence over config in `ui.movement.edit`; i.e. will negate `ui.movement.edit = false` 1556* `-n`, `--no-edit` — The inverse of `--edit` 1557 1558 Takes precedence over config in `ui.movement.edit`; i.e. will negate `ui.movement.edit = true` 1559* `--conflict` — Jump to the next conflicted descendant 1560 1561 1562 1563## `jj operation` 1564 1565Commands for working with the operation log 1566 1567See the [operation log documentation] for more information. 1568 1569[operation log documentation]: https://jj-vcs.github.io/jj/latest/operation-log/ 1570 1571**Usage:** `jj operation <COMMAND>` 1572 1573###### **Subcommands:** 1574 1575* `abandon` — Abandon operation history 1576* `diff` — Compare changes to the repository between two operations 1577* `log` — Show the operation log 1578* `restore` — Create a new operation that restores the repo to an earlier state 1579* `show` — Show changes to the repository in an operation 1580* `undo` — Create a new operation that undoes an earlier operation 1581 1582 1583 1584## `jj operation abandon` 1585 1586Abandon operation history 1587 1588To 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. 1589 1590To discard recent operations, use `jj op restore <operation ID>` followed by `jj op abandon <operation ID>..@-`. 1591 1592The abandoned operations, commits, and other unreachable objects can later be garbage collected by using `jj util gc` command. 1593 1594**Usage:** `jj operation abandon <OPERATION>` 1595 1596###### **Arguments:** 1597 1598* `<OPERATION>` — The operation or operation range to abandon 1599 1600 1601 1602## `jj operation diff` 1603 1604Compare changes to the repository between two operations 1605 1606**Usage:** `jj operation diff [OPTIONS]` 1607 1608###### **Options:** 1609 1610* `--operation <OPERATION>` — Show repository changes in this operation, compared to its parent 1611* `-f`, `--from <FROM>` — Show repository changes from this operation 1612* `-t`, `--to <TO>` — Show repository changes to this operation 1613* `--no-graph` — Don't show the graph, show a flat list of modified changes 1614* `-p`, `--patch` — Show patch of modifications to changes 1615 1616 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. 1617* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted 1618* `--stat` — Show a histogram of the changes 1619* `--types` — For each path, show only its type before and after 1620 1621 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. 1622* `--name-only` — For each path, show only its path 1623 1624 Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g` 1625* `--git` — Show a Git-format diff 1626* `--color-words` — Show a word-level diff with changes indicated only by color 1627* `--tool <TOOL>` — Generate diff by external command 1628* `--context <CONTEXT>` — Number of lines of context to show 1629* `--ignore-all-space` — Ignore whitespace when comparing lines 1630* `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines 1631 1632 1633 1634## `jj operation log` 1635 1636Show the operation log 1637 1638Like 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. 1639 1640**Usage:** `jj operation log [OPTIONS]` 1641 1642###### **Options:** 1643 1644* `-n`, `--limit <LIMIT>` — Limit number of operations to show 1645 1646 Applied after operations are reordered topologically, but before being reversed. 1647* `--reversed` — Show operations in the opposite order (older operations first) 1648* `--no-graph` — Don't show the graph, show a flat list of operations 1649* `-T`, `--template <TEMPLATE>` — Render each operation using the given template 1650 1651 You can specify arbitrary template expressions using the [built-in keywords]. See [`jj help -k templates`] for more information. 1652 1653 [built-in keywords]: https://jj-vcs.github.io/jj/latest/templates/#operation-keywords 1654 1655 [`jj help -k templates`]: https://jj-vcs.github.io/jj/latest/templates/ 1656* `-d`, `--op-diff` — Show changes to the repository at each operation 1657* `-p`, `--patch` — Show patch of modifications to changes (implies --op-diff) 1658 1659 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. 1660* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted 1661* `--stat` — Show a histogram of the changes 1662* `--types` — For each path, show only its type before and after 1663 1664 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. 1665* `--name-only` — For each path, show only its path 1666 1667 Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g` 1668* `--git` — Show a Git-format diff 1669* `--color-words` — Show a word-level diff with changes indicated only by color 1670* `--tool <TOOL>` — Generate diff by external command 1671* `--context <CONTEXT>` — Number of lines of context to show 1672* `--ignore-all-space` — Ignore whitespace when comparing lines 1673* `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines 1674 1675 1676 1677## `jj operation restore` 1678 1679Create a new operation that restores the repo to an earlier state 1680 1681This restores the repo to the state at the specified operation, effectively undoing all later operations. It does so by creating a new operation. 1682 1683**Usage:** `jj operation restore [OPTIONS] <OPERATION>` 1684 1685###### **Arguments:** 1686 1687* `<OPERATION>` — The operation to restore to 1688 1689 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. 1690 1691###### **Options:** 1692 1693* `--what <WHAT>` — What portions of the local state to restore (can be repeated) 1694 1695 This option is EXPERIMENTAL. 1696 1697 Default values: `repo`, `remote-tracking` 1698 1699 Possible values: 1700 - `repo`: 1701 The jj repo state and local bookmarks 1702 - `remote-tracking`: 1703 The remote-tracking bookmarks. Do not restore these if you'd like to push after the undo 1704 1705 1706 1707 1708## `jj operation show` 1709 1710Show changes to the repository in an operation 1711 1712**Usage:** `jj operation show [OPTIONS] [OPERATION]` 1713 1714###### **Arguments:** 1715 1716* `<OPERATION>` — Show repository changes in this operation, compared to its parent(s) 1717 1718 Default value: `@` 1719 1720###### **Options:** 1721 1722* `--no-graph` — Don't show the graph, show a flat list of modified changes 1723* `-p`, `--patch` — Show patch of modifications to changes 1724 1725 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. 1726* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted 1727* `--stat` — Show a histogram of the changes 1728* `--types` — For each path, show only its type before and after 1729 1730 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. 1731* `--name-only` — For each path, show only its path 1732 1733 Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g` 1734* `--git` — Show a Git-format diff 1735* `--color-words` — Show a word-level diff with changes indicated only by color 1736* `--tool <TOOL>` — Generate diff by external command 1737* `--context <CONTEXT>` — Number of lines of context to show 1738* `--ignore-all-space` — Ignore whitespace when comparing lines 1739* `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines 1740 1741 1742 1743## `jj operation undo` 1744 1745Create a new operation that undoes an earlier operation 1746 1747This undoes an individual operation by applying the inverse of the operation. 1748 1749**Usage:** `jj operation undo [OPTIONS] [OPERATION]` 1750 1751###### **Arguments:** 1752 1753* `<OPERATION>` — The operation to undo 1754 1755 Use `jj op log` to find an operation to undo. 1756 1757 Default value: `@` 1758 1759###### **Options:** 1760 1761* `--what <WHAT>` — What portions of the local state to restore (can be repeated) 1762 1763 This option is EXPERIMENTAL. 1764 1765 Default values: `repo`, `remote-tracking` 1766 1767 Possible values: 1768 - `repo`: 1769 The jj repo state and local bookmarks 1770 - `remote-tracking`: 1771 The remote-tracking bookmarks. Do not restore these if you'd like to push after the undo 1772 1773 1774 1775 1776## `jj parallelize` 1777 1778Parallelize revisions by making them siblings 1779 1780Running `jj parallelize 1::2` will transform the history like this: 1781```text 17823 1783| 3 17842 / \ 1785| -> 1 2 17861 \ / 1787| 0 17880 1789``` 1790 1791The command effectively says "these revisions are actually independent", 1792meaning that they should no longer be ancestors/descendants of each other. 1793However, revisions outside the set that were previously ancestors of a 1794revision in the set will remain ancestors of it. For example, revision 0 1795above remains an ancestor of both 1 and 2. Similarly, 1796revisions outside the set that were previously descendants of a revision 1797in the set will remain descendants of it. For example, revision 3 above 1798remains a descendant of both 1 and 2. 1799 1800Therefore, `jj parallelize '1 | 3'` is a no-op. That's because 2, which is 1801not in the target set, was a descendant of 1 before, so it remains a 1802descendant, and it was an ancestor of 3 before, so it remains an ancestor. 1803 1804**Usage:** `jj parallelize [REVSETS]...` 1805 1806###### **Arguments:** 1807 1808* `<REVSETS>` — Revisions to parallelize 1809 1810 1811 1812## `jj prev` 1813 1814Change the working copy revision relative to the parent revision 1815 1816The command creates a new empty working copy revision that is the child of 1817an ancestor `offset` revisions behind the parent of the current working 1818copy. 1819 1820For example, when the offset is 1: 1821 1822```text 1823D @ D 1824|/ | 1825A => A @ 1826| |/ 1827B B 1828``` 1829 1830If `--edit` is passed, the working copy revision is changed to the parent of 1831the current working copy revision. 1832 1833```text 1834D @ D 1835|/ | 1836C => @ 1837| | 1838B B 1839| | 1840A A 1841``` 1842 1843**Usage:** `jj prev [OPTIONS] [OFFSET]` 1844 1845###### **Arguments:** 1846 1847* `<OFFSET>` — How many revisions to move backward. Moves to the parent by default 1848 1849 Default value: `1` 1850 1851###### **Options:** 1852 1853* `-e`, `--edit` — Edit the parent directly, instead of moving the working-copy commit 1854 1855 Takes precedence over config in `ui.movement.edit`; i.e. will negate `ui.movement.edit = false` 1856* `-n`, `--no-edit` — The inverse of `--edit` 1857 1858 Takes precedence over config in `ui.movement.edit`; i.e. will negate `ui.movement.edit = true` 1859* `--conflict` — Jump to the previous conflicted ancestor 1860 1861 1862 1863## `jj rebase` 1864 1865Move revisions to different parent(s) 1866 1867This command moves revisions to different parent(s) while preserving the 1868changes (diff) in the revisions. 1869 1870There are three different ways of specifying which revisions to rebase: 1871 1872* `--source/-s` to rebase a revision and its descendants 1873* `--branch/-b` to rebase a whole branch, relative to the destination 1874* `--revisions/-r` to rebase the specified revisions without their 1875 descendants 1876 1877If no option is specified, it defaults to `-b @`. 1878 1879There are three different ways of specifying where the revisions should be 1880rebased to: 1881 1882* `--destination/-d` to rebase the revisions onto the specified targets 1883* `--insert-after/-A` to rebase the revisions onto the specified targets and 1884 to rebase the targets' descendants onto the rebased revisions 1885* `--insert-before/-B` to rebase the revisions onto the specified targets' 1886 parents and to rebase the targets and their descendants onto the rebased 1887 revisions 1888 1889See the sections below for details about the different ways of specifying 1890which revisions to rebase where. 1891 1892If a working-copy revision gets abandoned, it will be given a new, empty 1893revision. This is true in general; it is not specific to this command. 1894 1895### Specifying which revisions to rebase 1896 1897With `--source/-s`, the command rebases the specified revision and its 1898descendants onto the destination. For example, `jj rebase -s M -d O` would 1899transform your history like this (letters followed by an apostrophe are 1900post-rebase versions): 1901 1902```text 1903O N' 1904| | 1905| N M' 1906| | | 1907| M O 1908| | => | 1909| | L | L 1910| |/ | | 1911| K | K 1912|/ |/ 1913J J 1914``` 1915 1916Each revision passed to `-s` will become a direct child of the destination, 1917so if you instead run `jj rebase -s M -s N -d O` (or 1918`jj rebase -s 'all:M|N' -d O`) in the example above, then N' would instead 1919be a direct child of O. 1920 1921With `--branch/-b`, the command rebases the whole "branch" containing the 1922specified revision. A "branch" is the set of revisions that includes: 1923 1924* the specified revision and ancestors that are not also ancestors of the 1925 destination 1926* all descendants of those revisions 1927 1928In other words, `jj rebase -b X -d Y` rebases revisions in the revset 1929`(Y..X)::` (which is equivalent to `jj rebase -s 'roots(Y..X)' -d Y` for a 1930single root). For example, either `jj rebase -b L -d O` or `jj rebase -b M 1931-d O` would transform your history like this (because `L` and `M` are on the 1932same "branch", relative to the destination): 1933 1934```text 1935O N' 1936| | 1937| N M' 1938| | | 1939| M | L' 1940| | => |/ 1941| | L K' 1942| |/ | 1943| K O 1944|/ | 1945J J 1946``` 1947 1948With `--revisions/-r`, the command rebases only the specified revisions onto 1949the destination. Any "hole" left behind will be filled by rebasing 1950descendants onto the specified revisions' parent(s). For example, 1951`jj rebase -r K -d M` would transform your history like this: 1952 1953```text 1954M K' 1955| | 1956| L M 1957| | => | 1958| K | L' 1959|/ |/ 1960J J 1961``` 1962 1963Multiple revisions can be specified, and any dependencies (graph edges) 1964within the set will be preserved. For example, `jj rebase -r 'K|N' -d O` 1965would transform your history like this: 1966 1967```text 1968O N' 1969| | 1970| N K' 1971| | | 1972| M O 1973| | => | 1974| | L | M' 1975| |/ |/ 1976| K | L' 1977|/ |/ 1978J J 1979``` 1980 1981`jj rebase -s X` is similar to `jj rebase -r X::` and will behave the same 1982if X is a single revision. However, if X is a set of multiple revisions, 1983or if you passed multiple `-s` arguments, then `jj rebase -s` will make each 1984of the specified revisions an immediate child of the destination, while 1985`jj rebase -r` will preserve dependencies within the set. 1986 1987Note that you can create a merge revision by repeating the `-d` argument. 1988For example, if you realize that revision L actually depends on revision M 1989in order to work (in addition to its current parent K), you can run `jj 1990rebase -s L -d K -d M`: 1991 1992```text 1993M L' 1994| |\ 1995| L M | 1996| | => | | 1997| K | K 1998|/ |/ 1999J J 2000``` 2001 2002### Specifying where to rebase the revisions 2003 2004With `--destination/-d`, the command rebases the selected revisions onto 2005the targets. Existing descendants of the targets will not be affected. See 2006the section above for examples. 2007 2008With `--insert-after/-A`, the selected revisions will be inserted after the 2009targets. This is similar to `-d`, but if the targets have any existing 2010descendants, then those will be rebased onto the rebased selected revisions. 2011 2012For example, `jj rebase -r K -A L` will rewrite history like this: 2013```text 2014N N' 2015| | 2016| M | M' 2017|/ |/ 2018L => K' 2019| | 2020| K L 2021|/ | 2022J J 2023``` 2024 2025The `-A` (and `-B`) argument can also be used for reordering revisions. For 2026example, `jj rebase -r M -A J` will rewrite history like this: 2027```text 2028M L' 2029| | 2030L K' 2031| => | 2032K M' 2033| | 2034J J 2035``` 2036 2037With `--insert-before/-B`, the selected revisions will be inserted before 2038the targets. This is achieved by rebasing the selected revisions onto the 2039target revisions' parents, and then rebasing the target revisions and their 2040descendants onto the rebased revisions. 2041 2042For example, `jj rebase -r K -B L` will rewrite history like this: 2043```text 2044N N' 2045| | 2046| M | M' 2047|/ |/ 2048L => L' 2049| | 2050| K K' 2051|/ | 2052J J 2053``` 2054 2055The `-A` and `-B` arguments can also be combined, which can be useful around 2056merges. For example, you can use `jj rebase -r K -A J -B M` to create a new 2057merge (but `jj rebase -r M -d L -d K` might be simpler in this particular 2058case): 2059```text 2060M M' 2061| |\ 2062L L | 2063| => | | 2064| K | K' 2065|/ |/ 2066J J 2067``` 2068 2069To insert a commit inside an existing merge with `jj rebase -r O -A K -B M`: 2070```text 2071O N' 2072| |\ 2073N | M' 2074|\ | |\ 2075| M | O'| 2076| | => |/ / 2077| L | L 2078| | | | 2079K | K | 2080|/ |/ 2081J J 2082``` 2083 2084**Usage:** `jj rebase [OPTIONS] <--destination <REVSETS>|--insert-after <REVSETS>|--insert-before <REVSETS>>` 2085 2086###### **Options:** 2087 2088* `-b`, `--branch <REVSETS>` — Rebase the whole branch relative to destination's ancestors (can be repeated) 2089 2090 `jj rebase -b=br -d=dst` is equivalent to `jj rebase '-s=roots(dst..br)' -d=dst`. 2091 2092 If none of `-b`, `-s`, or `-r` is provided, then the default is `-b @`. 2093* `-s`, `--source <REVSETS>` — Rebase specified revision(s) together with their trees of descendants (can be repeated) 2094 2095 Each specified revision will become a direct child of the destination revision(s), even if some of the source revisions are descendants of others. 2096 2097 If none of `-b`, `-s`, or `-r` is provided, then the default is `-b @`. 2098* `-r`, `--revisions <REVSETS>` — Rebase the given revisions, rebasing descendants onto this revision's parent(s) 2099 2100 Unlike `-s` or `-b`, you may `jj rebase -r` a revision `A` onto a descendant of `A`. 2101 2102 If none of `-b`, `-s`, or `-r` is provided, then the default is `-b @`. 2103* `-d`, `--destination <REVSETS>` — The revision(s) to rebase onto (can be repeated to create a merge commit) 2104* `-A`, `--insert-after <REVSETS>` — The revision(s) to insert after (can be repeated to create a merge commit) 2105* `-B`, `--insert-before <REVSETS>` — The revision(s) to insert before (can be repeated to create a merge commit) 2106* `--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 2107 2108 2109 2110## `jj resolve` 2111 2112Resolve conflicted files with an external merge tool 2113 2114Only 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. 2115 2116Note 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. 2117 2118**Usage:** `jj resolve [OPTIONS] [FILESETS]...` 2119 2120###### **Arguments:** 2121 2122* `<FILESETS>` — Only resolve conflicts in these paths. You can use the `--list` argument to find paths to use here 2123 2124###### **Options:** 2125 2126* `-r`, `--revision <REVSET>` 2127 2128 Default value: `@` 2129* `-l`, `--list` — Instead of resolving conflicts, list all the conflicts 2130* `--tool <NAME>` — Specify 3-way merge tool to be used 2131 2132 2133 2134## `jj restore` 2135 2136Restore paths from another revision 2137 2138That means that the paths get the same content in the destination (`--to`) as they had in the source (`--from`). This is typically used for undoing changes to some paths in the working copy (`jj restore <paths>`). 2139 2140If only one of `--from` or `--to` is specified, the other one defaults to the working copy. 2141 2142When neither `--from` nor `--to` 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. 2143 2144See `jj diffedit` if you'd like to restore portions of files rather than entire files. 2145 2146**Usage:** `jj restore [OPTIONS] [FILESETS]...` 2147 2148###### **Arguments:** 2149 2150* `<FILESETS>` — Restore only these paths (instead of all paths) 2151 2152###### **Options:** 2153 2154* `-f`, `--from <REVSET>` — Revision to restore from (source) 2155* `-t`, `--into <REVSET>` — Revision to restore into (destination) 2156* `-c`, `--changes-in <REVSET>` — Undo the changes in a revision as compared to the merge of its parents. 2157 2158 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-`. 2159 2160 The default behavior of `jj restore` is equivalent to `jj restore --changes-in @`. 2161* `-i`, `--interactive` — Interactively choose which parts to restore 2162* `--tool <NAME>` — Specify diff editor to be used (implies --interactive) 2163* `--restore-descendants` — Preserve the content (not the diff) when rebasing descendants 2164 2165 2166 2167## `jj revert` 2168 2169Apply the reverse of the given revision(s) 2170 2171The reverse of each of the given revisions is applied sequentially in reverse topological order at the given location. 2172 2173The description of the new revisions can be customized with the `templates.revert_description` config variable. 2174 2175**Usage:** `jj revert [OPTIONS] <--destination <REVSETS>|--insert-after <REVSETS>|--insert-before <REVSETS>>` 2176 2177###### **Options:** 2178 2179* `-r`, `--revisions <REVSETS>` — The revision(s) to apply the reverse of 2180* `-d`, `--destination <REVSETS>` — The revision(s) to apply the reverse changes on top of 2181* `-A`, `--insert-after <REVSETS>` — The revision(s) to insert the reverse changes after (can be repeated to create a merge commit) 2182* `-B`, `--insert-before <REVSETS>` — The revision(s) to insert the reverse changes before (can be repeated to create a merge commit) 2183 2184 2185 2186## `jj root` 2187 2188Show the current workspace root directory (shortcut for `jj workspace root`) 2189 2190**Usage:** `jj root` 2191 2192 2193 2194## `jj show` 2195 2196Show commit description and changes in a revision 2197 2198**Usage:** `jj show [OPTIONS] [REVSET]` 2199 2200###### **Arguments:** 2201 2202* `<REVSET>` — Show changes in this revision, compared to its parent(s) 2203 2204 Default value: `@` 2205 2206###### **Options:** 2207 2208* `-T`, `--template <TEMPLATE>` — Render a revision using the given template 2209 2210 You can specify arbitrary template expressions using the [built-in keywords]. See [`jj help -k templates`] for more information. 2211 2212 [built-in keywords]: https://jj-vcs.github.io/jj/latest/templates/#commit-keywords 2213 2214 [`jj help -k templates`]: https://jj-vcs.github.io/jj/latest/templates/ 2215* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted 2216* `--stat` — Show a histogram of the changes 2217* `--types` — For each path, show only its type before and after 2218 2219 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. 2220* `--name-only` — For each path, show only its path 2221 2222 Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g` 2223* `--git` — Show a Git-format diff 2224* `--color-words` — Show a word-level diff with changes indicated only by color 2225* `--tool <TOOL>` — Generate diff by external command 2226* `--context <CONTEXT>` — Number of lines of context to show 2227* `--ignore-all-space` — Ignore whitespace when comparing lines 2228* `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines 2229 2230 2231 2232## `jj sign` 2233 2234Cryptographically sign a revision 2235 2236This command requires configuring a [commit signing] backend. 2237 2238[commit signing]: https://jj-vcs.github.io/jj/latest/config/#commit-signing 2239 2240**Usage:** `jj sign [OPTIONS]` 2241 2242###### **Options:** 2243 2244* `-r`, `--revisions <REVSETS>` — What revision(s) to sign 2245 2246 If no revisions are specified, this defaults to the `revsets.sign` setting. 2247 2248 Note that revisions are always re-signed. 2249 2250 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]). 2251 2252 [#5786]: https://github.com/jj-vcs/jj/issues/5786 2253* `--key <KEY>` — The key used for signing 2254 2255 2256 2257## `jj simplify-parents` 2258 2259Simplify parent edges for the specified revision(s). 2260 2261Removes 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. 2262 2263In 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. 2264 2265**Usage:** `jj simplify-parents [OPTIONS]` 2266 2267###### **Options:** 2268 2269* `-s`, `--source <REVSETS>` — Simplify specified revision(s) together with their trees of descendants (can be repeated) 2270* `-r`, `--revisions <REVSETS>` — Simplify specified revision(s) (can be repeated) 2271 2272 If both `--source` and `--revisions` are not provided, this defaults to the `revsets.simplify-parents` setting, or `reachable(@, mutable())` if it is not set. 2273 2274 2275 2276## `jj sparse` 2277 2278Manage which paths from the working-copy commit are present in the working copy 2279 2280**Usage:** `jj sparse <COMMAND>` 2281 2282###### **Subcommands:** 2283 2284* `edit` — Start an editor to update the patterns that are present in the working copy 2285* `list` — List the patterns that are currently present in the working copy 2286* `reset` — Reset the patterns to include all files in the working copy 2287* `set` — Update the patterns that are present in the working copy 2288 2289 2290 2291## `jj sparse edit` 2292 2293Start an editor to update the patterns that are present in the working copy 2294 2295**Usage:** `jj sparse edit` 2296 2297 2298 2299## `jj sparse list` 2300 2301List the patterns that are currently present in the working copy 2302 2303By 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). 2304 2305**Usage:** `jj sparse list` 2306 2307 2308 2309## `jj sparse reset` 2310 2311Reset the patterns to include all files in the working copy 2312 2313**Usage:** `jj sparse reset` 2314 2315 2316 2317## `jj sparse set` 2318 2319Update the patterns that are present in the working copy 2320 2321For 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`. 2322 2323**Usage:** `jj sparse set [OPTIONS]` 2324 2325###### **Options:** 2326 2327* `--add <ADD>` — Patterns to add to the working copy 2328* `--remove <REMOVE>` — Patterns to remove from the working copy 2329* `--clear` — Include no files in the working copy (combine with --add) 2330 2331 2332 2333## `jj split` 2334 2335Split a revision in two 2336 2337Starts a [diff editor] on the changes in the revision. Edit the right side of the diff until it has the content you want in the first revision. Once you close the editor, your edited content will replace the previous revision. The remaining changes will be put in a new revision on top. 2338 2339[diff editor]: https://jj-vcs.github.io/jj/latest/config/#editing-diffs 2340 2341If the change you split had a description, you will be asked to enter a change description for each commit. If the change did not have a description, the second part will not get a description, and you will be asked for a description only for the first part. 2342 2343Splitting an empty commit is not supported because the same effect can be achieved with `jj new`. 2344 2345**Usage:** `jj split [OPTIONS] [FILESETS]...` 2346 2347###### **Arguments:** 2348 2349* `<FILESETS>` — Files matching any of these filesets are put in the first commit 2350 2351###### **Options:** 2352 2353* `-i`, `--interactive` — Interactively choose which parts to split 2354 2355 This is the default if no filesets are provided. 2356* `--tool <NAME>` — Specify diff editor to be used (implies --interactive) 2357* `-r`, `--revision <REVSET>` — The revision to split 2358 2359 Default value: `@` 2360* `-p`, `--parallel` — Split the revision into two parallel revisions instead of a parent and child 2361 2362 2363 2364## `jj squash` 2365 2366Move changes from a revision into another revision 2367 2368With 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). 2369 2370With 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. 2371 2372If, 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. 2373 2374If 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. 2375 2376If 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. 2377 2378**Usage:** `jj squash [OPTIONS] [FILESETS]...` 2379 2380###### **Arguments:** 2381 2382* `<FILESETS>` — Move only changes to these paths (instead of all paths) 2383 2384###### **Options:** 2385 2386* `-r`, `--revision <REVSET>` — Revision to squash into its parent (default: @) 2387* `-f`, `--from <REVSETS>` — Revision(s) to squash from (default: @) 2388* `-t`, `--into <REVSET>` — Revision to squash into (default: @) 2389* `-m`, `--message <MESSAGE>` — The description to use for squashed revision (don't open editor) 2390* `-u`, `--use-destination-message` — Use the description of the destination revision and discard the description(s) of the source revision(s) 2391* `-i`, `--interactive` — Interactively choose which parts to squash 2392* `--tool <NAME>` — Specify diff editor to be used (implies --interactive) 2393* `-k`, `--keep-emptied` — The source revision will not be abandoned 2394 2395 2396 2397## `jj status` 2398 2399Show high-level repo status 2400 2401This includes: 2402 2403* The working copy commit and its (first) parent, and a summary of the changes between them * [Conflicted bookmarks] 2404 2405[Conflicted bookmarks]: https://jj-vcs.github.io/jj/latest/bookmarks/#conflicts 2406 2407**Usage:** `jj status [FILESETS]...` 2408 2409###### **Arguments:** 2410 2411* `<FILESETS>` — Restrict the status display to these paths 2412 2413 2414 2415## `jj tag` 2416 2417Manage tags 2418 2419**Usage:** `jj tag <COMMAND>` 2420 2421###### **Subcommands:** 2422 2423* `list` — List tags 2424 2425 2426 2427## `jj tag list` 2428 2429List tags 2430 2431**Usage:** `jj tag list [OPTIONS] [NAMES]...` 2432 2433###### **Arguments:** 2434 2435* `<NAMES>` — Show tags whose local name matches 2436 2437 By default, the specified name matches exactly. Use `glob:` prefix to select tags by [wildcard pattern]. 2438 2439 [wildcard pattern]: https://jj-vcs.github.io/jj/latest/revsets/#string-patterns 2440 2441###### **Options:** 2442 2443* `-T`, `--template <TEMPLATE>` — Render each tag using the given template 2444 2445 All 0-argument methods of the [`CommitRef` type] are available as keywords in the template expression. See [`jj help -k templates`] for more information. 2446 2447 [`CommitRef` type]: https://jj-vcs.github.io/jj/latest/templates/#commitref-type 2448 2449 [`jj help -k templates`]: https://jj-vcs.github.io/jj/latest/templates/ 2450 2451 2452 2453## `jj util` 2454 2455Infrequently used commands such as for generating shell completions 2456 2457**Usage:** `jj util <COMMAND>` 2458 2459###### **Subcommands:** 2460 2461* `completion` — Print a command-line-completion script 2462* `config-schema` — Print the JSON schema for the jj TOML config format 2463* `exec` — Execute an external command via jj 2464* `gc` — Run backend-dependent garbage collection 2465* `install-man-pages` — Install Jujutsu's manpages to the provided path 2466* `markdown-help` — Print the CLI help for all subcommands in Markdown 2467 2468 2469 2470## `jj util completion` 2471 2472Print a command-line-completion script 2473 2474Apply it by running one of these: 2475 2476- Bash: `source <(jj util completion bash)` 2477- Fish: `jj util completion fish | source` 2478- Nushell: 2479 ```nu 2480 jj util completion nushell | save "completions-jj.nu" 2481 use "completions-jj.nu" * # Or `source "completions-jj.nu"` 2482 ``` 2483- Zsh: 2484 ```shell 2485 autoload -U compinit 2486 compinit 2487 source <(jj util completion zsh) 2488 ``` 2489 2490**Usage:** `jj util completion [SHELL]` 2491 2492###### **Arguments:** 2493 2494* `<SHELL>` 2495 2496 Possible values: `bash`, `elvish`, `fish`, `nushell`, `power-shell`, `zsh` 2497 2498 2499 2500 2501## `jj util config-schema` 2502 2503Print the JSON schema for the jj TOML config format 2504 2505**Usage:** `jj util config-schema` 2506 2507 2508 2509## `jj util exec` 2510 2511Execute an external command via jj 2512 2513This is useful for arbitrary aliases. 2514 2515!! WARNING !! 2516 2517The following technique just provides a convenient syntax for running 2518arbitrary code on your system. Using it irresponsibly may cause damage 2519ranging from breaking the behavior of `jj undo` to wiping your file system. 2520Exercise the same amount of caution while writing these aliases as you would 2521when typing commands into the terminal! 2522 2523This feature may be removed or replaced by an embedded scripting language in 2524the future. 2525 2526Let's assume you have a script called "my-jj-script" in you $PATH and you 2527would like to execute it as "jj my-script". You would add the following line 2528to your configuration file to achieve that: 2529 2530```toml 2531[aliases] 2532my-script = ["util", "exec", "--", "my-jj-script"] 2533# ^^^^ 2534# This makes sure that flags are passed to your script instead of parsed by jj. 2535``` 2536 2537If you don't want to manage your script as a separate file, you can even 2538inline it into your config file: 2539 2540```toml 2541[aliases] 2542my-inline-script = ["util", "exec", "--", "bash", "-c", """ 2543#!/usr/bin/env bash 2544set -euo pipefail 2545echo "Look Ma, everything in one file!" 2546echo "args: $@" 2547""", ""] 2548# ^^ 2549# This last empty string will become "$0" in bash, so your actual arguments 2550# are all included in "$@" and start at "$1" as expected. 2551``` 2552 2553**Usage:** `jj util exec <COMMAND> [ARGS]...` 2554 2555###### **Arguments:** 2556 2557* `<COMMAND>` — External command to execute 2558* `<ARGS>` — Arguments to pass to the external command 2559 2560 2561 2562## `jj util gc` 2563 2564Run backend-dependent garbage collection. 2565 2566To garbage-collect old operations and the commits/objects referenced by then, run `jj op abandon ..<some old operation>` before `jj util gc`. 2567 2568Previous versions of a change that are reachable via the evolution log are not garbage-collected. 2569 2570**Usage:** `jj util gc [OPTIONS]` 2571 2572###### **Options:** 2573 2574* `--expire <EXPIRE>` — Time threshold 2575 2576 By default, only obsolete objects and operations older than 2 weeks are pruned. 2577 2578 Only the string "now" can be passed to this parameter. Support for arbitrary absolute and relative timestamps will come in a subsequent release. 2579 2580 2581 2582## `jj util install-man-pages` 2583 2584Install Jujutsu's manpages to the provided path 2585 2586**Usage:** `jj util install-man-pages <PATH>` 2587 2588###### **Arguments:** 2589 2590* `<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 2591 2592 2593 2594## `jj util markdown-help` 2595 2596Print the CLI help for all subcommands in Markdown 2597 2598**Usage:** `jj util markdown-help` 2599 2600 2601 2602## `jj undo` 2603 2604Undo an operation (shortcut for `jj op undo`) 2605 2606**Usage:** `jj undo [OPTIONS] [OPERATION]` 2607 2608###### **Arguments:** 2609 2610* `<OPERATION>` — The operation to undo 2611 2612 Use `jj op log` to find an operation to undo. 2613 2614 Default value: `@` 2615 2616###### **Options:** 2617 2618* `--what <WHAT>` — What portions of the local state to restore (can be repeated) 2619 2620 This option is EXPERIMENTAL. 2621 2622 Default values: `repo`, `remote-tracking` 2623 2624 Possible values: 2625 - `repo`: 2626 The jj repo state and local bookmarks 2627 - `remote-tracking`: 2628 The remote-tracking bookmarks. Do not restore these if you'd like to push after the undo 2629 2630 2631 2632 2633## `jj unsign` 2634 2635Drop a cryptographic signature 2636 2637See also [commit signing] docs. 2638 2639[commit signing]: https://jj-vcs.github.io/jj/latest/config/#commit-signing 2640 2641**Usage:** `jj unsign [OPTIONS]` 2642 2643###### **Options:** 2644 2645* `-r`, `--revisions <REVSETS>` — What revision(s) to unsign 2646 2647 2648 2649## `jj version` 2650 2651Display version information 2652 2653**Usage:** `jj version` 2654 2655 2656 2657## `jj workspace` 2658 2659Commands for working with workspaces 2660 2661Workspaces 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. 2662 2663Each 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`. 2664 2665Each workspace also has own sparse patterns. 2666 2667**Usage:** `jj workspace <COMMAND>` 2668 2669###### **Subcommands:** 2670 2671* `add` — Add a workspace 2672* `forget` — Stop tracking a workspace's working-copy commit in the repo 2673* `list` — List workspaces 2674* `rename` — Renames the current workspace 2675* `root` — Show the current workspace root directory 2676* `update-stale` — Update a workspace that has become stale 2677 2678 2679 2680## `jj workspace add` 2681 2682Add a workspace 2683 2684By default, the new workspace inherits the sparse patterns of the current workspace. You can override this with the `--sparse-patterns` option. 2685 2686**Usage:** `jj workspace add [OPTIONS] <DESTINATION>` 2687 2688###### **Arguments:** 2689 2690* `<DESTINATION>` — Where to create the new workspace 2691 2692###### **Options:** 2693 2694* `--name <NAME>` — A name for the workspace 2695 2696 To override the default, which is the basename of the destination directory. 2697* `-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. 2698 2699 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). 2700 2701 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 ...`. 2702* `--sparse-patterns <SPARSE_PATTERNS>` — How to handle sparse patterns when creating a new workspace 2703 2704 Default value: `copy` 2705 2706 Possible values: 2707 - `copy`: 2708 Copy all sparse patterns from the current workspace 2709 - `full`: 2710 Include all files in the new workspace 2711 - `empty`: 2712 Clear all files from the workspace (it will be empty) 2713 2714 2715 2716 2717## `jj workspace forget` 2718 2719Stop tracking a workspace's working-copy commit in the repo 2720 2721The workspace will not be touched on disk. It can be deleted from disk before or after running this command. 2722 2723**Usage:** `jj workspace forget [WORKSPACES]...` 2724 2725###### **Arguments:** 2726 2727* `<WORKSPACES>` — Names of the workspaces to forget. By default, forgets only the current workspace 2728 2729 2730 2731## `jj workspace list` 2732 2733List workspaces 2734 2735**Usage:** `jj workspace list` 2736 2737 2738 2739## `jj workspace rename` 2740 2741Renames the current workspace 2742 2743**Usage:** `jj workspace rename <NEW_WORKSPACE_NAME>` 2744 2745###### **Arguments:** 2746 2747* `<NEW_WORKSPACE_NAME>` — The name of the workspace to update to 2748 2749 2750 2751## `jj workspace root` 2752 2753Show the current workspace root directory 2754 2755**Usage:** `jj workspace root` 2756 2757 2758 2759## `jj workspace update-stale` 2760 2761Update a workspace that has become stale 2762 2763See the [stale working copy documentation] for more information. 2764 2765[stale working copy documentation]: https://jj-vcs.github.io/jj/latest/working-copy/#stale-working-copy 2766 2767**Usage:** `jj workspace update-stale` 2768 2769 2770 2771<hr/> 2772 2773<small><i> 2774 This document was generated automatically by 2775 <a href="https://crates.io/crates/clap-markdown"><code>clap-markdown</code></a>. 2776</i></small>