-
Notifications
You must be signed in to change notification settings - Fork 344
2474 lines (1447 loc) · 84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
source: cli/tests/test_generate_md_cli_help.rs
description: "AUTO-GENERATED FILE, DO NOT EDIT. This cli reference is generated by a test as an `insta` snapshot. MkDocs includes this snapshot from docs/cli-reference.md."
snapshot_kind: text
---
<!-- BEGIN MARKDOWN-->
# Command-Line Help for `jj`
This document contains the help content for the `jj` command-line program.
**Command Overview:**
* [`jj`↴](#jj)
* [`jj abandon`↴](#jj-abandon)
* [`jj absorb`↴](#jj-absorb)
* [`jj backout`↴](#jj-backout)
* [`jj bookmark`↴](#jj-bookmark)
* [`jj bookmark create`↴](#jj-bookmark-create)
* [`jj bookmark delete`↴](#jj-bookmark-delete)
* [`jj bookmark forget`↴](#jj-bookmark-forget)
* [`jj bookmark list`↴](#jj-bookmark-list)
* [`jj bookmark move`↴](#jj-bookmark-move)
* [`jj bookmark rename`↴](#jj-bookmark-rename)
* [`jj bookmark set`↴](#jj-bookmark-set)
* [`jj bookmark track`↴](#jj-bookmark-track)
* [`jj bookmark untrack`↴](#jj-bookmark-untrack)
* [`jj commit`↴](#jj-commit)
* [`jj config`↴](#jj-config)
* [`jj config edit`↴](#jj-config-edit)
* [`jj config get`↴](#jj-config-get)
* [`jj config list`↴](#jj-config-list)
* [`jj config path`↴](#jj-config-path)
* [`jj config set`↴](#jj-config-set)
* [`jj config unset`↴](#jj-config-unset)
* [`jj describe`↴](#jj-describe)
* [`jj diff`↴](#jj-diff)
* [`jj diffedit`↴](#jj-diffedit)
* [`jj duplicate`↴](#jj-duplicate)
* [`jj edit`↴](#jj-edit)
* [`jj evolog`↴](#jj-evolog)
* [`jj file`↴](#jj-file)
* [`jj file annotate`↴](#jj-file-annotate)
* [`jj file chmod`↴](#jj-file-chmod)
* [`jj file list`↴](#jj-file-list)
* [`jj file show`↴](#jj-file-show)
* [`jj file track`↴](#jj-file-track)
* [`jj file untrack`↴](#jj-file-untrack)
* [`jj fix`↴](#jj-fix)
* [`jj git`↴](#jj-git)
* [`jj git clone`↴](#jj-git-clone)
* [`jj git export`↴](#jj-git-export)
* [`jj git fetch`↴](#jj-git-fetch)
* [`jj git import`↴](#jj-git-import)
* [`jj git init`↴](#jj-git-init)
* [`jj git push`↴](#jj-git-push)
* [`jj git remote`↴](#jj-git-remote)
* [`jj git remote add`↴](#jj-git-remote-add)
* [`jj git remote list`↴](#jj-git-remote-list)
* [`jj git remote remove`↴](#jj-git-remote-remove)
* [`jj git remote rename`↴](#jj-git-remote-rename)
* [`jj git remote set-url`↴](#jj-git-remote-set-url)
* [`jj help`↴](#jj-help)
* [`jj init`↴](#jj-init)
* [`jj interdiff`↴](#jj-interdiff)
* [`jj log`↴](#jj-log)
* [`jj new`↴](#jj-new)
* [`jj next`↴](#jj-next)
* [`jj operation`↴](#jj-operation)
* [`jj operation abandon`↴](#jj-operation-abandon)
* [`jj operation diff`↴](#jj-operation-diff)
* [`jj operation log`↴](#jj-operation-log)
* [`jj operation restore`↴](#jj-operation-restore)
* [`jj operation show`↴](#jj-operation-show)
* [`jj operation undo`↴](#jj-operation-undo)
* [`jj parallelize`↴](#jj-parallelize)
* [`jj prev`↴](#jj-prev)
* [`jj rebase`↴](#jj-rebase)
* [`jj resolve`↴](#jj-resolve)
* [`jj restore`↴](#jj-restore)
* [`jj root`↴](#jj-root)
* [`jj show`↴](#jj-show)
* [`jj simplify-parents`↴](#jj-simplify-parents)
* [`jj sparse`↴](#jj-sparse)
* [`jj sparse edit`↴](#jj-sparse-edit)
* [`jj sparse list`↴](#jj-sparse-list)
* [`jj sparse reset`↴](#jj-sparse-reset)
* [`jj sparse set`↴](#jj-sparse-set)
* [`jj split`↴](#jj-split)
* [`jj squash`↴](#jj-squash)
* [`jj status`↴](#jj-status)
* [`jj tag`↴](#jj-tag)
* [`jj tag list`↴](#jj-tag-list)
* [`jj util`↴](#jj-util)
* [`jj util completion`↴](#jj-util-completion)
* [`jj util config-schema`↴](#jj-util-config-schema)
* [`jj util exec`↴](#jj-util-exec)
* [`jj util gc`↴](#jj-util-gc)
* [`jj util mangen`↴](#jj-util-mangen)
* [`jj util markdown-help`↴](#jj-util-markdown-help)
* [`jj undo`↴](#jj-undo)
* [`jj version`↴](#jj-version)
* [`jj workspace`↴](#jj-workspace)
* [`jj workspace add`↴](#jj-workspace-add)
* [`jj workspace forget`↴](#jj-workspace-forget)
* [`jj workspace list`↴](#jj-workspace-list)
* [`jj workspace rename`↴](#jj-workspace-rename)
* [`jj workspace root`↴](#jj-workspace-root)
* [`jj workspace update-stale`↴](#jj-workspace-update-stale)
## `jj`
Jujutsu (An experimental VCS)
To get started, see the tutorial at https://jj-vcs.github.io/jj/latest/tutorial/.
**Usage:** `jj [OPTIONS] [COMMAND]`
'jj help --help' list available keywords. Use 'jj help -k' to show help for one of these keywords.
###### **Subcommands:**
* `abandon` — Abandon a revision
* `absorb` — Move changes from a revision into the stack of mutable revisions
* `backout` — Apply the reverse of a revision on top of another revision
* `bookmark` — Manage bookmarks [default alias: b]
* `commit` — Update the description and create a new change on top
* `config` — Manage config options
* `describe` — Update the change description or other metadata
* `diff` — Compare file contents between two revisions
* `diffedit` — Touch up the content changes in a revision with a diff editor
* `duplicate` — Create new changes with the same content as existing ones
* `edit` — Sets the specified revision as the working-copy revision
* `evolog` — Show how a change has evolved over time
* `file` — File operations
* `fix` — Update files with formatting fixes or other changes
* `git` — Commands for working with Git remotes and the underlying Git repo
* `help` — Print this message or the help of the given subcommand(s)
* `init` — Create a new repo in the given directory
* `interdiff` — Compare the changes of two commits
* `log` — Show revision history
* `new` — Create a new, empty change and (by default) edit it in the working copy
* `next` — Move the working-copy commit to the child revision
* `operation` — Commands for working with the operation log
* `parallelize` — Parallelize revisions by making them siblings
* `prev` — Change the working copy revision relative to the parent revision
* `rebase` — Move revisions to different parent(s)
* `resolve` — Resolve a conflicted file with an external merge tool
* `restore` — Restore paths from another revision
* `root` — Show the current workspace root directory
* `show` — Show commit description and changes in a revision
* `simplify-parents` — Simplify parent edges for the specified revision(s)
* `sparse` — Manage which paths from the working-copy commit are present in the working copy
* `split` — Split a revision in two
* `squash` — Move changes from a revision into another revision
* `status` — Show high-level repo status
* `tag` — Manage tags
* `util` — Infrequently used commands such as for generating shell completions
* `undo` — Undo an operation (shortcut for `jj op undo`)
* `version` — Display version information
* `workspace` — Commands for working with workspaces
###### **Options:**
* `-R`, `--repository <REPOSITORY>` — Path to repository to operate on
By default, Jujutsu searches for the closest .jj/ directory in an ancestor of the current working directory.
* `--ignore-working-copy` — Don't snapshot the working copy, and don't update it
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.
Loading the repository at a specific operation with `--at-operation` implies `--ignore-working-copy`.
* `--ignore-immutable` — Allow rewriting immutable commits
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.
This option only affects the check. It does not affect the `immutable_heads()` revset or the `immutable` template keyword.
* `--at-operation <AT_OPERATION>` — Operation to load the repo at
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.
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.
Use `jj op log` to find the operation ID you want. Any unambiguous prefix of the operation ID is enough.
When loading the repo at an earlier operation, the working copy will be ignored, as if `--ignore-working-copy` had been specified.
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.
* `--debug` — Enable debug logging
* `--color <WHEN>` — When to colorize output (always, never, debug, auto)
* `--quiet` — Silence non-primary command output
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.
Warnings and errors will still be printed.
* `--no-pager` — Disable the pager
* `--config <NAME=VALUE>` — Additional configuration options (can be repeated)
The name should be specified as TOML dotted keys. The value should be specified as a TOML expression. If string value doesn't contain any TOML constructs (such as array notation), quotes can be omitted.
* `--config-file <PATH>` — Additional configuration files (can be repeated)
## `jj abandon`
Abandon a revision
Abandon a revision, rebasing descendants onto its parent(s). The behavior is similar to `jj restore --changes-in`; the difference is that `jj abandon` gives you a new change, while `jj restore` updates the existing change.
If a working-copy commit gets abandoned, it will be given a new, empty commit. This is true in general; it is not specific to this command.
**Usage:** `jj abandon [OPTIONS] [REVSETS]...`
###### **Arguments:**
* `<REVSETS>` — The revision(s) to abandon
Default value: `@`
###### **Options:**
* `-s`, `--summary` — Do not print every abandoned commit on a separate line
* `--restore-descendants` — Do not modify the content of the children of the abandoned commits
## `jj absorb`
Move changes from a revision into the stack of mutable revisions
This command splits changes in the source revision and moves each change to the closest mutable ancestor where the corresponding lines were modified last. If the destination revision cannot be determined unambiguously, the change will be left in the source revision.
The modification made by `jj absorb` can be reviewed by `jj op show -p`.
**Usage:** `jj absorb [OPTIONS] [FILESETS]...`
###### **Arguments:**
* `<FILESETS>` — Move only changes to these paths (instead of all paths)
###### **Options:**
* `-f`, `--from <REVSET>` — Source revision to absorb from
Default value: `@`
* `-t`, `--into <REVSETS>` — Destination revisions to absorb into
Only ancestors of the source revision will be considered.
Default value: `mutable()`
## `jj backout`
Apply the reverse of a revision on top of another revision
**Usage:** `jj backout [OPTIONS]`
###### **Options:**
* `-r`, `--revisions <REVSETS>` — The revision(s) to apply the reverse of
Default value: `@`
* `-d`, `--destination <REVSETS>` — The revision to apply the reverse changes on top of
Default value: `@`
## `jj bookmark`
Manage bookmarks [default alias: b]
For information about bookmarks, see https://jj-vcs.github.io/jj/latest/bookmarks.
**Usage:** `jj bookmark <COMMAND>`
###### **Subcommands:**
* `create` — Create a new bookmark
* `delete` — Delete an existing bookmark and propagate the deletion to remotes on the next push
* `forget` — Forget everything about a bookmark, including its local and remote targets
* `list` — List bookmarks and their targets
* `move` — Move existing bookmarks to target revision
* `rename` — Rename `old` bookmark name to `new` bookmark name
* `set` — Create or update a bookmark to point to a certain commit
* `track` — Start tracking given remote bookmarks
* `untrack` — Stop tracking given remote bookmarks
## `jj bookmark create`
Create a new bookmark
**Usage:** `jj bookmark create [OPTIONS] <NAMES>...`
###### **Arguments:**
* `<NAMES>` — The bookmarks to create
###### **Options:**
* `-r`, `--revision <REVSET>` — The bookmark's target revision
## `jj bookmark delete`
Delete an existing bookmark and propagate the deletion to remotes on the next push
**Usage:** `jj bookmark delete <NAMES>...`
###### **Arguments:**
* `<NAMES>` — The bookmarks to delete
By default, the specified name matches exactly. Use `glob:` prefix to select bookmarks by wildcard pattern. For details, see https://jj-vcs.github.io/jj/latest/revsets/#string-patterns.
## `jj bookmark forget`
Forget everything about a bookmark, including its local and remote targets
A forgotten bookmark will not impact remotes on future pushes. It will be recreated on future pulls if it still exists in the remote.
**Usage:** `jj bookmark forget <NAMES>...`
###### **Arguments:**
* `<NAMES>` — The bookmarks to forget
By default, the specified name matches exactly. Use `glob:` prefix to select bookmarks by wildcard pattern. For details, see https://jj-vcs.github.io/jj/latest/revsets/#string-patterns.
## `jj bookmark list`
List bookmarks and their targets
By 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 "+".
For information about bookmarks, see https://jj-vcs.github.io/jj/latest/bookmarks/.
**Usage:** `jj bookmark list [OPTIONS] [NAMES]...`
###### **Arguments:**
* `<NAMES>` — Show bookmarks whose local name matches
By default, the specified name matches exactly. Use `glob:` prefix to select bookmarks by wildcard pattern. For details, see https://jj-vcs.github.io/jj/latest/revsets/#string-patterns.
###### **Options:**
* `-a`, `--all-remotes` — Show all tracking and non-tracking remote bookmarks including the ones whose targets are synchronized with the local bookmarks
* `--remote <REMOTE>` — Show all tracking and non-tracking remote bookmarks belonging to this remote
Can be combined with `--tracked` or `--conflicted` to filter the bookmarks shown (can be repeated.)
By default, the specified remote name matches exactly. Use `glob:` prefix to select remotes by wildcard pattern. For details, see https://jj-vcs.github.io/jj/latest/revsets/#string-patterns.
* `-t`, `--tracked` — Show remote tracked bookmarks only. Omits local Git-tracking bookmarks by default
* `-c`, `--conflicted` — Show conflicted bookmarks only
* `-r`, `--revisions <REVSETS>` — Show bookmarks whose local targets are in the given revisions
Note that `-r deleted_bookmark` will not work since `deleted_bookmark` wouldn't have a local target.
* `-T`, `--template <TEMPLATE>` — Render each bookmark using the given template
All 0-argument methods of the `RefName` type are available as keywords.
For the syntax, see https://jj-vcs.github.io/jj/latest/templates/
## `jj bookmark move`
Move existing bookmarks to target revision
If bookmark names are given, the specified bookmarks will be updated to point to the target revision.
If `--from` options are given, bookmarks currently pointing to the specified revisions will be updated. The bookmarks can also be filtered by names.
Example: pull up the nearest bookmarks to the working-copy parent
$ jj bookmark move --from 'heads(::@- & bookmarks())' --to @-
**Usage:** `jj bookmark move [OPTIONS] <--from <REVSETS>|NAMES>`
###### **Arguments:**
* `<NAMES>` — Move bookmarks matching the given name patterns
By default, the specified name matches exactly. Use `glob:` prefix to select bookmarks by wildcard pattern. For details, see https://jj-vcs.github.io/jj/latest/revsets/#string-patterns.
###### **Options:**
* `--from <REVSETS>` — Move bookmarks from the given revisions
* `--to <REVSET>` — Move bookmarks to this revision
Default value: `@`
* `-B`, `--allow-backwards` — Allow moving bookmarks backwards or sideways
## `jj bookmark rename`
Rename `old` bookmark name to `new` bookmark name
The new bookmark name points at the same commit as the old bookmark name.
**Usage:** `jj bookmark rename <OLD> <NEW>`
###### **Arguments:**
* `<OLD>` — The old name of the bookmark
* `<NEW>` — The new name of the bookmark
## `jj bookmark set`
Create or update a bookmark to point to a certain commit
**Usage:** `jj bookmark set [OPTIONS] <NAMES>...`
###### **Arguments:**
* `<NAMES>` — The bookmarks to update
###### **Options:**
* `-r`, `--revision <REVSET>` — The bookmark's target revision
* `-B`, `--allow-backwards` — Allow moving the bookmark backwards or sideways
## `jj bookmark track`
Start tracking given remote bookmarks
A 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.
**Usage:** `jj bookmark track <BOOKMARK@REMOTE>...`
###### **Arguments:**
* `<BOOKMARK@REMOTE>` — Remote bookmarks to track
By default, the specified name matches exactly. Use `glob:` prefix to select bookmarks by wildcard pattern. For details, see https://jj-vcs.github.io/jj/latest/revsets/#string-patterns.
Examples: bookmark@remote, glob:main@*, glob:jjfan-*@upstream
## `jj bookmark untrack`
Stop tracking given remote bookmarks
A 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.
**Usage:** `jj bookmark untrack <BOOKMARK@REMOTE>...`
###### **Arguments:**
* `<BOOKMARK@REMOTE>` — Remote bookmarks to untrack
By default, the specified name matches exactly. Use `glob:` prefix to select bookmarks by wildcard pattern. For details, see https://jj-vcs.github.io/jj/latest/revsets/#string-patterns.
Examples: bookmark@remote, glob:main@*, glob:jjfan-*@upstream
## `jj commit`
Update the description and create a new change on top
**Usage:** `jj commit [OPTIONS] [FILESETS]...`
###### **Arguments:**
* `<FILESETS>` — Put these paths in the first commit
###### **Options:**
* `-i`, `--interactive` — Interactively choose which changes to include in the first commit
* `--tool <NAME>` — Specify diff editor to be used (implies --interactive)
* `-m`, `--message <MESSAGE>` — The change description to use (don't open editor)
* `--reset-author` — Reset the author to the configured user
This resets the author name, email, and timestamp.
You can use it in combination with the JJ_USER and JJ_EMAIL environment variables to set a different author:
$ JJ_USER='Foo Bar' [email protected] jj commit --reset-author
* `--author <AUTHOR>` — Set author to the provided string
This changes author name and email while retaining author timestamp for non-discardable commits.
## `jj config`
Manage config options
Operates on jj configuration, which comes from the config file and environment variables.
For file locations, supported config options, and other details about jj config, see https://jj-vcs.github.io/jj/latest/config/.
**Usage:** `jj config <COMMAND>`
###### **Subcommands:**
* `edit` — Start an editor on a jj config file
* `get` — Get the value of a given config option.
* `list` — List variables set in config file, along with their values
* `path` — Print the path to the config file
* `set` — Update config file to set the given option to a given value
* `unset` — Update config file to unset the given option
## `jj config edit`
Start an editor on a jj config file.
Creates the file if it doesn't already exist regardless of what the editor does.
**Usage:** `jj config edit <--user|--repo>`
###### **Options:**
* `--user` — Target the user-level config
* `--repo` — Target the repo-level config
## `jj config get`
Get the value of a given config option.
Unlike `jj config list`, the result of `jj config get` is printed without
extra formatting and therefore is usable in scripting. For example:
$ jj config list user.name
user.name="Martin von Zweigbergk"
$ jj config get user.name
Martin von Zweigbergk
**Usage:** `jj config get <NAME>`
###### **Arguments:**
* `<NAME>`
## `jj config list`
List variables set in config file, along with their values
**Usage:** `jj config list [OPTIONS] [NAME]`
###### **Arguments:**
* `<NAME>` — An optional name of a specific config option to look up
###### **Options:**
* `--include-defaults` — Whether to explicitly include built-in default values in the list
* `--include-overridden` — Allow printing overridden values
* `--user` — Target the user-level config
* `--repo` — Target the repo-level config
* `-T`, `--template <TEMPLATE>` — Render each variable using the given template
The following keywords are defined:
* `name: String`: Config name.
* `value: String`: Serialized value in TOML syntax.
* `overridden: Boolean`: True if the value is shadowed by other.
For the syntax, see https://jj-vcs.github.io/jj/latest/templates/
## `jj config path`
Print the path to the config file
A config file at that path may or may not exist.
See `jj config edit` if you'd like to immediately edit the file.
**Usage:** `jj config path <--user|--repo>`
###### **Options:**
* `--user` — Target the user-level config
* `--repo` — Target the repo-level config
## `jj config set`
Update config file to set the given option to a given value
**Usage:** `jj config set <--user|--repo> <NAME> <VALUE>`
###### **Arguments:**
* `<NAME>`
* `<VALUE>` — New value to set
The value should be specified as a TOML expression. If string value doesn't contain any TOML constructs (such as array notation), quotes can be omitted.
###### **Options:**
* `--user` — Target the user-level config
* `--repo` — Target the repo-level config
## `jj config unset`
Update config file to unset the given option
**Usage:** `jj config unset <--user|--repo> <NAME>`
###### **Arguments:**
* `<NAME>`
###### **Options:**
* `--user` — Target the user-level config
* `--repo` — Target the repo-level config
## `jj describe`
Update the change description or other metadata
Starts 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).
**Usage:** `jj describe [OPTIONS] [REVSETS]...`
###### **Arguments:**
* `<REVSETS>` — The revision(s) whose description to edit
Default value: `@`
###### **Options:**
* `-m`, `--message <MESSAGE>` — The change description to use (don't open editor)
If multiple revisions are specified, the same description will be used for all of them.
* `--stdin` — Read the change description from stdin
If multiple revisions are specified, the same description will be used for all of them.
* `--no-edit` — Don't open an editor
This is mainly useful in combination with e.g. `--reset-author`.
* `--reset-author` — Reset the author to the configured user
This resets the author name, email, and timestamp.
You can use it in combination with the JJ_USER and JJ_EMAIL environment variables to set a different author:
$ JJ_USER='Foo Bar' [email protected] jj describe --reset-author
* `--author <AUTHOR>` — Set author to the provided string
This changes author name and email while retaining author timestamp for non-discardable commits.
## `jj diff`
Compare file contents between two revisions
With 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.
With the `--from` and/or `--to` options, shows the difference from/to the given revisions. If either is left out, it defaults to the working-copy commit. For example, `jj diff --from main` shows the changes from "main" (perhaps a bookmark name) to the working-copy commit.
**Usage:** `jj diff [OPTIONS] [FILESETS]...`
###### **Arguments:**
* `<FILESETS>` — Restrict the diff to these paths
###### **Options:**
* `-r`, `--revision <REVSET>` — Show changes in this revision, compared to its parent(s)
If the 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.
* `-f`, `--from <REVSET>` — Show changes from this revision
* `-t`, `--to <REVSET>` — Show changes to this revision
* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
* `--stat` — Show a histogram of the changes
* `--types` — For each path, show only its type before and after
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.
* `--name-only` — For each path, show only its path
Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g`
* `--git` — Show a Git-format diff
* `--color-words` — Show a word-level diff with changes indicated only by color
* `--tool <TOOL>` — Generate diff by external command
* `--context <CONTEXT>` — Number of lines of context to show
* `-w`, `--ignore-all-space` — Ignore whitespace when comparing lines
* `-b`, `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines
## `jj diffedit`
Touch up the content changes in a revision with a diff editor
With the `-r` option, which is the default, starts a [diff editor] on the changes in the revision.
With the `--from` and/or `--to` options, starts a [diff editor] comparing the "from" revision to the "to" revision.
[diff editor]: https://jj-vcs.github.io/jj/latest/config/#editing-diffs
Edit the right side of the diff until it looks the way you want. Once you close the editor, the revision specified with `-r` or `--to` will be updated. Unless `--restore-descendants` is used, descendants will be rebased on top as usual, which may result in conflicts.
See `jj restore` if you want to move entire files from one revision to another. For moving changes between revisions, see `jj squash -i`.
**Usage:** `jj diffedit [OPTIONS]`
###### **Options:**
* `-r`, `--revision <REVSET>` — The revision to touch up
Defaults to @ if neither --to nor --from are specified.
* `-f`, `--from <REVSET>` — Show changes from this revision
Defaults to @ if --to is specified.
* `-t`, `--to <REVSET>` — Edit changes in this revision
Defaults to @ if --from is specified.
* `--tool <NAME>` — Specify diff editor to be used
* `--restore-descendants` — Preserve the content (not the diff) when rebasing descendants
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.
## `jj duplicate`
Create new changes with the same content as existing ones
When 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.
When 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.
**Usage:** `jj duplicate [OPTIONS] [REVSETS]...`
###### **Arguments:**
* `<REVSETS>` — The revision(s) to duplicate (default: @)
###### **Options:**
* `-d`, `--destination <REVSETS>` — The revision(s) to duplicate onto (can be repeated to create a merge commit)
* `-A`, `--insert-after <REVSETS>` — The revision(s) to insert after (can be repeated to create a merge commit)
* `-B`, `--insert-before <REVSETS>` — The revision(s) to insert before (can be repeated to create a merge commit)
## `jj edit`
Sets the specified revision as the working-copy revision
Note: it is generally recommended to instead use `jj new` and `jj squash`.
For more information, see https://jj-vcs.github.io/jj/latest/FAQ#how-do-i-resume-working-on-an-existing-change
**Usage:** `jj edit <REVSET>`
###### **Arguments:**
* `<REVSET>` — The commit to edit
## `jj evolog`
Show how a change has evolved over time
Lists the previous commits which a change has pointed to. The current commit of a change evolves when the change is updated, rebased, etc.
**Usage:** `jj evolog [OPTIONS]`
###### **Options:**
* `-r`, `--revision <REVSET>`
Default value: `@`
* `-n`, `--limit <LIMIT>` — Limit number of revisions to show
* `--no-graph` — Don't show the graph, show a flat list of revisions
* `-T`, `--template <TEMPLATE>` — Render each revision using the given template
For the syntax, see https://jj-vcs.github.io/jj/latest/templates/
* `-p`, `--patch` — Show patch compared to the previous version of this change
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.
* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted
* `--stat` — Show a histogram of the changes
* `--types` — For each path, show only its type before and after
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.
* `--name-only` — For each path, show only its path
Typically useful for shell commands like: `jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g`
* `--git` — Show a Git-format diff
* `--color-words` — Show a word-level diff with changes indicated only by color
* `--tool <TOOL>` — Generate diff by external command
* `--context <CONTEXT>` — Number of lines of context to show
* `--ignore-all-space` — Ignore whitespace when comparing lines
* `--ignore-space-change` — Ignore changes in amount of whitespace when comparing lines
## `jj file`
File operations
**Usage:** `jj file <COMMAND>`
###### **Subcommands:**
* `annotate` — Show the source change for each line of the target file
* `chmod` — Sets or removes the executable bit for paths in the repo
* `list` — List files in a revision
* `show` — Print contents of files in a revision
* `track` — Start tracking specified paths in the working copy
* `untrack` — Stop tracking specified paths in the working copy
## `jj file annotate`
Show the source change for each line of the target file.
Annotates a revision line by line. Each line includes the source change that introduced the associated line. A path to the desired file must be provided. The per-line prefix for each line can be customized via template with the `templates.annotate_commit_summary` config variable.
**Usage:** `jj file annotate [OPTIONS] <PATH>`
###### **Arguments:**
* `<PATH>` — the file to annotate
###### **Options:**
* `-r`, `--revision <REVSET>` — an optional revision to start at
## `jj file chmod`
Sets or removes the executable bit for paths in the repo
Unlike the POSIX `chmod`, `jj file chmod` also works on Windows, on conflicted files, and on arbitrary revisions.
**Usage:** `jj file chmod [OPTIONS] <MODE> <FILESETS>...`
###### **Arguments:**
* `<MODE>`
Possible values:
- `n`:
Make a path non-executable (alias: normal)
- `x`:
Make a path executable (alias: executable)
* `<FILESETS>` — Paths to change the executable bit for
###### **Options:**
* `-r`, `--revision <REVSET>` — The revision to update
Default value: `@`
## `jj file list`
List files in a revision
**Usage:** `jj file list [OPTIONS] [FILESETS]...`
###### **Arguments:**
* `<FILESETS>` — Only list files matching these prefixes (instead of all files)
###### **Options:**
* `-r`, `--revision <REVSET>` — The revision to list files in
Default value: `@`
## `jj file show`
Print contents of files in a revision
If the given path is a directory, files in the directory will be visited recursively.
**Usage:** `jj file show [OPTIONS] <FILESETS>...`
###### **Arguments:**
* `<FILESETS>` — Paths to print
###### **Options:**
* `-r`, `--revision <REVSET>` — The revision to get the file contents from
Default value: `@`
## `jj file track`
Start tracking specified paths in the working copy
Without arguments, all paths that are not ignored will be tracked.
New 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.
**Usage:** `jj file track <FILESETS>...`
###### **Arguments:**
* `<FILESETS>` — Paths to track
## `jj file untrack`
Stop tracking specified paths in the working copy
**Usage:** `jj file untrack <FILESETS>...`
###### **Arguments:**
* `<FILESETS>` — Paths to untrack. They must already be ignored.
The paths could be ignored via a .gitignore or .git/info/exclude (in colocated repos).
## `jj fix`
Update files with formatting fixes or other changes
The primary use case for this command is to apply the results of automatic
code formatting tools to revisions that may not be properly formatted yet.
It can also be used to modify files with other tools like `sed` or `sort`.
The changed files in the given revisions will be updated with any fixes
determined by passing their file content through any external tools the user
has configured for those files. Descendants will also be updated by passing
their versions of the same files through the same tools, which will ensure
that the fixes are not lost. This will never result in new conflicts. Files
with existing conflicts will be updated on all sides of the conflict, which
can potentially increase or decrease the number of conflict markers.
The external tools must accept the current file content on standard input,
and return the updated file content on standard output. A tool's output will
not be used unless it exits with a successful exit code. Output on standard
error will be passed through to the terminal.
Tools are defined in a table where the keys are arbitrary identifiers and
the values have the following properties:
- `command`: The arguments used to run the tool. The first argument is the
path to an executable file. Arguments can contain the substring `$path`,
which will be replaced with the repo-relative path of the file being
fixed. It is useful to provide the path to tools that include the path in
error messages, or behave differently based on the directory or file
name.
- `patterns`: Determines which files the tool will affect. If this list is
empty, no files will be affected by the tool. If there are multiple
patterns, the tool is applied only once to each file in the union of the
patterns.
For example, the following configuration defines how two code formatters
(`clang-format` and `black`) will apply to three different file extensions
(`.cc`, `.h`, and `.py`):
```toml
[fix.tools.clang-format]
command = ["/usr/bin/clang-format", "--assume-filename=$path"]
patterns = ["glob:'**/*.cc'",
"glob:'**/*.h'"]