From 52c415eaf4206c2af59c9319a4250221cd30a6c4 Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Sat, 27 Jan 2024 19:31:27 -0800 Subject: [PATCH] docs: store output of `jj util markdown-help`, render it on the website I am using a very hacky approach, using `insta` to generate the markdown help. This is based on a lucky coincidence that `insta` chose to use a header format for snapshot files that MkDocs interprets as a Markdown header (and ignores). I considered several other approaches, but I couldn't resist the facts that: - This doesn't require new developers to install any extra tools or run any extra commands. - There is no need for a new CI check. - There is no need to compile `jj` in the "Make HTML docs" GitHub action, which is currently very fast and cheap. Downside: I'm not sure how well MkDocs will work on Windows, unless the developer explicitly enables symbolic links (which IIUC is not trivial). ### Possible alternatives My next favorite approaches (which we could switch to later) would be: #### `xtask` Set up a CI check and a [Cargo `xtask`] so that `cargo xtask cli-help-to-md` essentially runs `cargo run -- util markdown-help > docs/cli-reference.md` from the project root. Every developer would have to know to run `cargo xtask cli-help-to-md` if they change the help text. Eventually, we could have `cargo xtask preflight` that runs `cargo +nightly fmt; cargo xtask cli-help-to-md; cargo nextest run`, or `cargo insta`. #### Only generate markdown for CLI help when building the website, don't track it in Git. I think that having the file in the repo will be nice to preview changes to docs, and it'll allow people to consult the file on GitHub or in their repo. The (currently) very fast job of building the website would now require installing Rust and building `jj`. #### Same as the `xtask`, but use a shell script instead of an `xtask` An `xtask` might seem like overkill, since it's Rust instead of a shell script. However, I don't want this to be a shell script so that new contributors on Windows can still easily run it ( since this will be necessary for the CI to pass) without us having to support a batch file. #### Cargo Alias My first attempt was to set up a [cargo alias] to run this, but that doesn't support redirection (so I had to change the `jj util` command to output to a file) and, worse, is incapable of executing the command *in the project root* regardless of where in the project the current directory is. Again, this seems to be too inconvenient for a command that every new PR author would have to run to pass CI. Overall, this just seems a bit ugly. I did file https://github.com/rust-lang/cargo/issues/13348, I'm not really sure that was worthwhile, though. **Aside:** For reference, the alias was: ```toml # .cargo/config.toml alias.gen-cli-reference = "run -p jj-cli -- util markdown-help docs/cli-reference.md" ``` ### Non-alternatives #### Clap's new feature `clap` recently obtained a similarly-sounding feature in https://github.com/clap-rs/clap/pull/5206. However, it only prints short help for subcommands and can't be triggered by an option AFAICT, so it won't help us too much. [Cargo `xtask`]: https://github.com/matklad/cargo-xtask [cargo alias]: https://doc.rust-lang.org/cargo/reference/config.html#alias --- .gitignore | 1 + cli/tests/cli-reference@.md.snap | 1959 ++++++++++++++++++++++++ cli/tests/test_generate_md_cli_help.rs | 39 + docs/cli-reference.md | 1 + mkdocs.yml | 2 + 5 files changed, 2002 insertions(+) create mode 100644 cli/tests/cli-reference@.md.snap create mode 100644 cli/tests/test_generate_md_cli_help.rs create mode 120000 docs/cli-reference.md diff --git a/.gitignore b/.gitignore index 8b9c52f9b..89c2f9150 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ result # generated by the insta crate *.pending-snap *.snap* +!cli/tests/cli-reference@.md.snap # Editor specific ignores .idea diff --git a/cli/tests/cli-reference@.md.snap b/cli/tests/cli-reference@.md.snap new file mode 100644 index 000000000..ea76d3cef --- /dev/null +++ b/cli/tests/cli-reference@.md.snap @@ -0,0 +1,1959 @@ +--- +source: cli/tests/test_generate_md_cli_help.rs +description: "AUTO-GENERATED FILE, DO NOT EDIT. This cli reference is generated as an `insta` snapshot. MkDocs follows they symlink from docs/cli-reference.md to the snap. Unfortunately, `insta` unavoidably creates this header. Luckily, MkDocs ignores the header since it has the same format as Markdown headers. TODO: MkDocs may fail on Windows if symlinks are not enabled in the OS settings" +--- +# 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 backout`↴](#jj-backout) +* [`jj branch`↴](#jj-branch) +* [`jj branch create`↴](#jj-branch-create) +* [`jj branch delete`↴](#jj-branch-delete) +* [`jj branch forget`↴](#jj-branch-forget) +* [`jj branch list`↴](#jj-branch-list) +* [`jj branch rename`↴](#jj-branch-rename) +* [`jj branch set`↴](#jj-branch-set) +* [`jj branch track`↴](#jj-branch-track) +* [`jj branch untrack`↴](#jj-branch-untrack) +* [`jj cat`↴](#jj-cat) +* [`jj checkout`↴](#jj-checkout) +* [`jj chmod`↴](#jj-chmod) +* [`jj commit`↴](#jj-commit) +* [`jj config`↴](#jj-config) +* [`jj config list`↴](#jj-config-list) +* [`jj config get`↴](#jj-config-get) +* [`jj config set`↴](#jj-config-set) +* [`jj config edit`↴](#jj-config-edit) +* [`jj describe`↴](#jj-describe) +* [`jj diff`↴](#jj-diff) +* [`jj diffedit`↴](#jj-diffedit) +* [`jj duplicate`↴](#jj-duplicate) +* [`jj edit`↴](#jj-edit) +* [`jj files`↴](#jj-files) +* [`jj git`↴](#jj-git) +* [`jj git remote`↴](#jj-git-remote) +* [`jj git remote add`↴](#jj-git-remote-add) +* [`jj git remote remove`↴](#jj-git-remote-remove) +* [`jj git remote rename`↴](#jj-git-remote-rename) +* [`jj git remote list`↴](#jj-git-remote-list) +* [`jj git fetch`↴](#jj-git-fetch) +* [`jj git clone`↴](#jj-git-clone) +* [`jj git push`↴](#jj-git-push) +* [`jj git import`↴](#jj-git-import) +* [`jj git export`↴](#jj-git-export) +* [`jj init`↴](#jj-init) +* [`jj interdiff`↴](#jj-interdiff) +* [`jj log`↴](#jj-log) +* [`jj merge`↴](#jj-merge) +* [`jj move`↴](#jj-move) +* [`jj new`↴](#jj-new) +* [`jj next`↴](#jj-next) +* [`jj obslog`↴](#jj-obslog) +* [`jj operation`↴](#jj-operation) +* [`jj operation abandon`↴](#jj-operation-abandon) +* [`jj operation log`↴](#jj-operation-log) +* [`jj operation undo`↴](#jj-operation-undo) +* [`jj operation restore`↴](#jj-operation-restore) +* [`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 sparse`↴](#jj-sparse) +* [`jj sparse list`↴](#jj-sparse-list) +* [`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 gc`↴](#jj-util-gc) +* [`jj util mangen`↴](#jj-util-mangen) +* [`jj util markdown-help`↴](#jj-util-markdown-help) +* [`jj util config-schema`↴](#jj-util-config-schema) +* [`jj undo`↴](#jj-undo) +* [`jj unsquash`↴](#jj-unsquash) +* [`jj untrack`↴](#jj-untrack) +* [`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 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://github.com/martinvonz/jj/blob/main/docs/tutorial.md. + +**Usage:** `jj [OPTIONS] [COMMAND]` + +###### **Subcommands:** + +* `abandon` — Abandon a revision +* `backout` — Apply the reverse of a revision on top of another revision +* `branch` — Manage branches +* `cat` — Print contents of a file in a revision +* `checkout` — Create a new, empty change and edit it in the working copy +* `chmod` — Sets or removes the executable bit for paths in the repo +* `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 commits +* `diffedit` — Touch up the content changes in a revision with a diff editor +* `duplicate` — Create a new change with the same content as an existing one +* `edit` — Edit a commit in the working copy +* `files` — List files in a revision +* `git` — Commands for working with the underlying Git repo +* `init` — Create a new repo in the given directory +* `interdiff` — Compare the changes of two commits +* `log` — Show commit history +* `merge` — Merge work from multiple branches +* `move` — Move changes from one revision into another +* `new` — Create a new, empty change and (by default) edit it in the working copy +* `next` — Move the current working copy commit to the next child revision in the +repository. +* `obslog` — Show how a change has evolved +* `operation` — Commands for working with the operation log +* `prev` — Move the working copy commit to the parent of the current 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 +* `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 its parent +* `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`) +* `unsquash` — Move changes from a revision's parent into the revision +* `untrack` — Stop tracking specified paths in the working copy +* `version` — Display version information +* `workspace` — Commands for working with workspaces + +###### **Options:** + +* `-R`, `--repository ` — Path to repository to operate on +* `--ignore-working-copy` — Don't snapshot the working copy, and don't update it + + Possible values: `true`, `false` + +* `--at-operation ` — Operation to load the repo at + + Default value: `@` +* `-v`, `--verbose` — Enable verbose logging + + Possible values: `true`, `false` + +* `--color ` — When to colorize output (always, never, auto) +* `--no-pager` — Disable the pager + + Possible values: `true`, `false` + +* `--config-toml ` — Additional configuration options (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. + +**Usage:** `jj abandon [OPTIONS] [REVISIONS]...` + +###### **Arguments:** + +* `` — The revision(s) to abandon + + Default value: `@` + +###### **Options:** + +* `-s`, `--summary` — Do not print every abandoned commit on a separate line + + Possible values: `true`, `false` + +* `-r` — Ignored (but lets you pass `-r` for consistency with other commands) + + Possible values: `true`, `false` + + + + +## `jj backout` + +Apply the reverse of a revision on top of another revision + +**Usage:** `jj backout [OPTIONS]` + +###### **Options:** + +* `-r`, `--revision ` — The revision to apply the reverse of + + Default value: `@` +* `-d`, `--destination ` — The revision to apply the reverse changes on top of + + Default value: `@` + + + +## `jj branch` + +Manage branches. + +For information about branches, see https://github.com/martinvonz/jj/blob/main/docs/branches.md. + +**Usage:** `jj branch ` + +###### **Subcommands:** + +* `create` — Create a new branch +* `delete` — Delete an existing branch and propagate the deletion to remotes on the next push +* `forget` — Forget everything about a branch, including its local and remote targets +* `list` — List branches and their targets +* `rename` — Rename `old` branch name to `new` branch name +* `set` — Update an existing branch to point to a certain commit +* `track` — Start tracking given remote branches +* `untrack` — Stop tracking given remote branches + + + +## `jj branch create` + +Create a new branch + +**Usage:** `jj branch create [OPTIONS] ...` + +###### **Arguments:** + +* `` — The branches to create + +###### **Options:** + +* `-r`, `--revision ` — The branch's target revision + + + +## `jj branch delete` + +Delete an existing branch and propagate the deletion to remotes on the next push + +**Usage:** `jj branch delete [NAMES]...` + +###### **Arguments:** + +* `` — The branches to delete + +###### **Options:** + +* `--glob ` — Deprecated. Please prefix the pattern with `glob:` instead + + + +## `jj branch forget` + +Forget everything about a branch, including its local and remote targets. + +A forgotten branch will not impact remotes on future pushes. It will be recreated on future pulls if it still exists in the remote. + +**Usage:** `jj branch forget [NAMES]...` + +###### **Arguments:** + +* `` — The branches to forget + +###### **Options:** + +* `--glob ` — Deprecated. Please prefix the pattern with `glob:` instead + + + +## `jj branch list` + +List branches and their targets + +By default, a tracking remote branch will be included only if its target is different from the local target. A non-tracking remote branch won't be listed. For a conflicted branch (both local and remote), old target revisions are preceded by a "-" and new target revisions are preceded by a "+". + +For information about branches, see https://github.com/martinvonz/jj/blob/main/docs/branches.md. + +**Usage:** `jj branch list [OPTIONS] [NAMES]...` + +###### **Arguments:** + +* `` — Show branches whose local name matches + +###### **Options:** + +* `-a`, `--all` — Show all tracking and non-tracking remote branches including the ones whose targets are synchronized with the local branches + + Possible values: `true`, `false` + +* `-r`, `--revisions ` — Show branches whose local targets are in the given revisions + + + +## `jj branch rename` + +Rename `old` branch name to `new` branch name. + +The new branch name points at the same commit as the old branch name. + +**Usage:** `jj branch rename ` + +###### **Arguments:** + +* `` — The old name of the branch +* `` — The new name of the branch + + + +## `jj branch set` + +Update an existing branch to point to a certain commit + +**Usage:** `jj branch set [OPTIONS] ...` + +###### **Arguments:** + +* `` — The branches to update + +###### **Options:** + +* `-r`, `--revision ` — The branch's target revision +* `-B`, `--allow-backwards` — Allow moving the branch backwards or sideways + + Possible values: `true`, `false` + + + + +## `jj branch track` + +Start tracking given remote branches + +A tracking remote branch will be imported as a local branch of the same name. Changes to it will propagate to the existing local branch on future pulls. + +**Usage:** `jj branch track ...` + +###### **Arguments:** + +* `` — Remote branches to track + + + +## `jj branch untrack` + +Stop tracking given remote branches + +A non-tracking remote branch is just a pointer to the last-fetched remote branch. It won't be imported as a local branch on future pulls. + +**Usage:** `jj branch untrack ...` + +###### **Arguments:** + +* `` — Remote branches to untrack + + + +## `jj cat` + +Print contents of a file in a revision + +**Usage:** `jj cat [OPTIONS] ` + +###### **Arguments:** + +* `` — The file to print + +###### **Options:** + +* `-r`, `--revision ` — The revision to get the file contents from + + Default value: `@` + + + +## `jj checkout` + +Create a new, empty change and edit it in the working copy + +For more information, see https://github.com/martinvonz/jj/blob/main/docs/working-copy.md. + +**Usage:** `jj checkout [OPTIONS] ` + +###### **Arguments:** + +* `` — The revision to update to + +###### **Options:** + +* `-r` — Ignored (but lets you pass `-r` for consistency with other commands) + + Possible values: `true`, `false` + +* `-m`, `--message ` — The change description to use + + + +## `jj chmod` + +Sets or removes the executable bit for paths in the repo + +Unlike the POSIX `chmod`, `jj chmod` also works on Windows, on conflicted files, and on arbitrary revisions. + +**Usage:** `jj chmod [OPTIONS] ...` + +###### **Arguments:** + +* `` + + Possible values: + - `n`: + Make a path non-executable (alias: normal) + - `x`: + Make a path executable (alias: executable) + +* `` — Paths to change the executable bit for + +###### **Options:** + +* `-r`, `--revision ` — The revision to update + + Default value: `@` + + + +## `jj commit` + +Update the description and create a new change on top + +**Usage:** `jj commit [OPTIONS] [PATHS]...` + +###### **Arguments:** + +* `` — Put these paths in the first commit + +###### **Options:** + +* `-i`, `--interactive` — Interactively choose which changes to include in the first commit + + Possible values: `true`, `false` + +* `-m`, `--message ` — The change description to use (don't open editor) + + + +## `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://github.com/martinvonz/jj/blob/main/docs/config.md. + +**Usage:** `jj config ` + +###### **Subcommands:** + +* `list` — List variables set in config file, along with their values +* `get` — Get the value of a given config option. +* `set` — Update config file to set the given option to a given value +* `edit` — Start an editor on a jj config file + + + +## `jj config list` + +List variables set in config file, along with their values + +**Usage:** `jj config list [OPTIONS] [NAME]` + +###### **Arguments:** + +* `` — 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 + + Possible values: `true`, `false` + +* `--include-overridden` — Allow printing overridden values + + Possible values: `true`, `false` + +* `--user` — Target the user-level config + + Possible values: `true`, `false` + +* `--repo` — Target the repo-level config + + Possible values: `true`, `false` + + + + +## `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 ` + +###### **Arguments:** + +* `` + + + +## `jj config set` + +Update config file to set the given option to a given value + +**Usage:** `jj config set <--user|--repo> ` + +###### **Arguments:** + +* `` +* `` + +###### **Options:** + +* `--user` — Target the user-level config + + Possible values: `true`, `false` + +* `--repo` — Target the repo-level config + + Possible values: `true`, `false` + + + + +## `jj config edit` + +Start an editor on a jj config file + +**Usage:** `jj config edit <--user|--repo>` + +###### **Options:** + +* `--user` — Target the user-level config + + Possible values: `true`, `false` + +* `--repo` — Target the repo-level config + + Possible values: `true`, `false` + + + + +## `jj describe` + +Update the change description or other metadata + +Starts an editor to let you edit the description of a change. The editor will be $EDITOR, or `pico` if that's not defined (`Notepad` on Windows). + +**Usage:** `jj describe [OPTIONS] [REVISION]` + +###### **Arguments:** + +* `` — The revision whose description to edit + + Default value: `@` + +###### **Options:** + +* `-r` — Ignored (but lets you pass `-r` for consistency with other commands) + + Possible values: `true`, `false` + +* `-m`, `--message ` — The change description to use (don't open editor) +* `--stdin` — Read the change description from stdin + + Possible values: `true`, `false` + +* `--no-edit` — Don't open an editor + + Possible values: `true`, `false` + +* `--reset-author` — Reset the author to the configured user + + Possible values: `true`, `false` + + + + +## `jj diff` + +Compare file contents between two commits + +**Usage:** `jj diff [OPTIONS] [PATHS]...` + +###### **Arguments:** + +* `` — Restrict the diff to these paths + +###### **Options:** + +* `-r`, `--revision ` — Show changes in this revision, compared to its parent(s) +* `--from ` — Show changes from this revision +* `--to ` — Show changes to this revision +* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted + + Possible values: `true`, `false` + +* `--stat` — Show a histogram of the changes + + Possible values: `true`, `false` + +* `--types` — For each path, show only its type before and after + + Possible values: `true`, `false` + +* `--git` — Show a Git-format diff + + Possible values: `true`, `false` + +* `--color-words` — Show a word-level diff with changes indicated only by color + + Possible values: `true`, `false` + +* `--tool ` — Generate diff by external command + + + +## `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 (`meld` by default) 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. + +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. 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. See `jj squash -i` or `jj unsquash -i` if you instead want to move changes into or out of the parent revision. + +**Usage:** `jj diffedit [OPTIONS]` + +###### **Options:** + +* `-r`, `--revision ` — The revision to touch up. Defaults to @ if neither --to nor --from are specified +* `--from ` — Show changes from this revision. Defaults to @ if --to is specified +* `--to ` — Edit changes in this revision. Defaults to @ if --from is specified + + + +## `jj duplicate` + +Create a new change with the same content as an existing one + +**Usage:** `jj duplicate [REVISIONS]...` + +###### **Arguments:** + +* `` — The revision(s) to duplicate + + Default value: `@` + +###### **Options:** + +* `-r` — Ignored (but lets you pass `-r` for consistency with other commands) + + Possible values: `true`, `false` + + + + +## `jj edit` + +Edit a commit in the working copy + +Puts the contents of a commit in the working copy for editing. Any changes you make in the working copy will update (amend) the commit. + +**Usage:** `jj edit ` + +###### **Arguments:** + +* `` — The commit to edit + +###### **Options:** + +* `-r` — Ignored (but lets you pass `-r` for consistency with other commands) + + Possible values: `true`, `false` + + + + +## `jj files` + +List files in a revision + +**Usage:** `jj files [OPTIONS] [PATHS]...` + +###### **Arguments:** + +* `` — Only list files matching these prefixes (instead of all files) + +###### **Options:** + +* `-r`, `--revision ` — The revision to list files in + + Default value: `@` + + + +## `jj git` + +Commands for working with the underlying Git repo + +For a comparison with Git, including a table of commands, see https://github.com/martinvonz/jj/blob/main/docs/git-comparison.md. + +**Usage:** `jj git ` + +###### **Subcommands:** + +* `remote` — Manage Git remotes +* `fetch` — Fetch from a Git remote +* `clone` — Create a new repo backed by a clone of a Git repo +* `push` — Push to a Git remote +* `import` — Update repo with changes made in the underlying Git repo +* `export` — Update the underlying Git repo with changes made in the repo + + + +## `jj git remote` + +Manage Git remotes + +The Git repo will be a bare git repo stored inside the `.jj/` directory. + +**Usage:** `jj git remote ` + +###### **Subcommands:** + +* `add` — Add a Git remote +* `remove` — Remove a Git remote and forget its branches +* `rename` — Rename a Git remote +* `list` — List Git remotes + + + +## `jj git remote add` + +Add a Git remote + +**Usage:** `jj git remote add ` + +###### **Arguments:** + +* `` — The remote's name +* `` — The remote's URL + + + +## `jj git remote remove` + +Remove a Git remote and forget its branches + +**Usage:** `jj git remote remove ` + +###### **Arguments:** + +* `` — The remote's name + + + +## `jj git remote rename` + +Rename a Git remote + +**Usage:** `jj git remote rename ` + +###### **Arguments:** + +* `` — The name of an existing remote +* `` — The desired name for `old` + + + +## `jj git remote list` + +List Git remotes + +**Usage:** `jj git remote list` + + + +## `jj git fetch` + +Fetch from a Git remote + +**Usage:** `jj git fetch [OPTIONS]` + +###### **Options:** + +* `--branch ` — Fetch only some of the branches + + Default value: `glob:*` +* `--remote ` — The remote to fetch from (only named remotes are supported, can be repeated) +* `--all-remotes` — Fetch from all remotes + + Possible values: `true`, `false` + + + + +## `jj git clone` + +Create a new repo backed by a clone of a Git repo + +The Git repo will be a bare git repo stored inside the `.jj/` directory. + +**Usage:** `jj git clone [OPTIONS] [DESTINATION]` + +###### **Arguments:** + +* `` — URL or path of the Git repo to clone +* `` — The directory to write the Jujutsu repo to + +###### **Options:** + +* `--colocate` — Whether or not to colocate the Jujutsu repo with the git repo + + Possible values: `true`, `false` + + + + +## `jj git push` + +Push to a Git remote + +By default, pushes any branches pointing to `remote_branches(remote=)..@`. Use `--branch` to push specific branches. Use `--all` to push all branches. Use `--change` to generate branch names based on the change IDs of specific commits. + +**Usage:** `jj git push [OPTIONS]` + +###### **Options:** + +* `--remote ` — The remote to push to (only named remotes are supported) +* `-b`, `--branch ` — Push only this branch (can be repeated) +* `--all` — Push all branches (including deleted branches) + + Possible values: `true`, `false` + +* `--deleted` — Push all deleted branches + + Possible values: `true`, `false` + +* `-r`, `--revisions ` — Push branches pointing to these commits +* `-c`, `--change ` — Push this commit by creating a branch based on its change ID (can be repeated) +* `--dry-run` — Only display what will change on the remote + + Possible values: `true`, `false` + + + + +## `jj git import` + +Update repo with changes made in the underlying Git repo + +**Usage:** `jj git import` + + + +## `jj git export` + +Update the underlying Git repo with changes made in the repo + +**Usage:** `jj git export` + + + +## `jj init` + +Create a new repo in the given directory + +If the given directory does not exist, it will be created. If no directory is given, the current directory is used. + +**Usage:** `jj init [OPTIONS] [DESTINATION]` + +###### **Arguments:** + +* `` — The destination directory + + Default value: `.` + +###### **Options:** + +* `--git` — Use the Git backend, creating a jj repo backed by a Git repo + + Possible values: `true`, `false` + +* `--git-repo ` — Path to a git repo the jj repo will be backed by + + + +## `jj interdiff` + +Compare the changes of two commits + +This 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 obslog -p` instead. + +**Usage:** `jj interdiff [OPTIONS] <--from |--to > [PATHS]...` + +###### **Arguments:** + +* `` — Restrict the diff to these paths + +###### **Options:** + +* `--from ` — Show changes from this revision +* `--to ` — Show changes to this revision +* `-s`, `--summary` — For each path, show only whether it was modified, added, or deleted + + Possible values: `true`, `false` + +* `--stat` — Show a histogram of the changes + + Possible values: `true`, `false` + +* `--types` — For each path, show only its type before and after + + Possible values: `true`, `false` + +* `--git` — Show a Git-format diff + + Possible values: `true`, `false` + +* `--color-words` — Show a word-level diff with changes indicated only by color + + Possible values: `true`, `false` + +* `--tool ` — Generate diff by external command + + + +## `jj log` + +Show commit history + +**Usage:** `jj log [OPTIONS] [PATHS]...` + +###### **Arguments:** + +* `` — Show commits modifying the given paths + +###### **Options:** + +* `-r`, `--revisions ` — Which revisions to show. Defaults to the `revsets.log` setting, or `@ | ancestors(immutable_heads().., 2) | heads(immutable_heads())` if it is not set +* `--reversed` — Show revisions in the opposite order (older revisions first) + + Possible values: `true`, `false` + +* `-l`, `--limit ` — Limit number of revisions to show +* `--no-graph` — Don't show the graph, show a flat list of revisions + + Possible values: `true`, `false` + +* `-T`, `--template