diff --git a/prerelease/search/search_index.json b/prerelease/search/search_index.json
index 056f15ecf..9ffd897d8 100644
--- a/prerelease/search/search_index.json
+++ b/prerelease/search/search_index.json
@@ -1 +1 @@
-{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Jujutsu\u2014a version control system","text":""},{"location":"#welcome-to-jjs-documentation-website","title":"Welcome to jj
's documentation website!","text":"The complete list of the available documentation pages is located in the sidebar on the left of the page. The sidebar may be hidden; if so, you can open it either by widening your browser window or by clicking on the hamburger menu that appears in this situation.
Additional help is available using the jj help
command if you have jj
installed.
You may want to jump to:
- Documentation for the latest released version of
jj
. - Documentation for the unreleased version of
jj
. This version of the docs corresponds to the main
branch of the jj
repo.
"},{"location":"#some-useful-links","title":"Some useful links","text":" - GitHub repo for
jj
- Overview of
jj
in the repo's README - Installation and Setup
- Tutorial and Birds-Eye View
- Working with GitHub
- Development Roadmap
"},{"location":"FAQ/","title":"Frequently asked questions","text":""},{"location":"FAQ/#why-does-my-bookmark-not-move-to-the-new-commit-after-jj-newcommit","title":"Why does my bookmark not move to the new commit after jj new/commit
?","text":"If you're familiar with Git, you might expect the current bookmark to move forward when you commit. However, Jujutsu does not have a concept of a \"current bookmark\".
To move bookmarks, use jj bookmark move
.
"},{"location":"FAQ/#i-made-a-commit-and-jj-git-push-all-says-nothing-changed-instead-of-pushing-it-what-do-i-do","title":"I made a commit and jj git push --all
says \"Nothing changed\" instead of pushing it. What do I do?","text":"jj git push --all
pushes all bookmarks, not all revisions. You have two options:
- Using
jj git push --change
will automatically create a bookmark and push it. - Using
jj bookmark
commands to create or move a bookmark to either the commit you want to push or a descendant on it. Unlike Git, Jujutsu doesn't do this automatically (see previous question).
"},{"location":"FAQ/#where-is-my-commit-why-is-it-not-visible-in-jj-log","title":"Where is my commit, why is it not visible in jj log
?","text":"Is your commit visible with jj log -r 'all()'
?
If yes, you should be aware that jj log
only shows the revisions matching revsets.log
by default. You can change it as described in config to show more revisions.
If not, the revision may have been abandoned (e.g. because you used jj abandon
, or because it's an obsolete version that's been rewritten with jj rebase
, jj describe
, etc). In that case, jj log -r commit_id
should show the revision as \"hidden\". jj new commit_id
should make the revision visible again.
See revsets and templates for further guidance.
"},{"location":"FAQ/#what-are-elided-revisions-in-the-output-of-jj-log-how-can-i-display-them","title":"What are elided revisions in the output of jj log
? How can I display them?","text":"\"Elided revisions\" appears in the log when one revision descends from another, both are in the revset, but the revisions connecting them are not in the revset.
For example, suppose you log the revset tyl|mus
which contains exactly two revisions:
$ jj log -r 'tyl|mus'\n\u25cb musnqzvt me@example.com 1 minute ago 9a09f8a5\n\u2502 Revision C\n~ (elided revisions)\n\u25cb tylynnzk me@example.com 1 minute ago f26967c8\n\u2502 Revision A\n
Only the two revisions in the revset are displayed. The text \"(elided revisions)\" is shown to indicate that musnqzvt
descends from tylynnzk
, but the nodes connecting them are not in the revset.
To view the elided revisions, change the revset expression so it includes the connecting revisions. The connected()
revset function does exactly this:
$ jj log -r 'connected(tyl|mus)'\n\u25cb musnqzvt me@example.com 43 seconds ago 9a09f8a5\n\u2502 Revision C\n\u25cb rsvnrznr me@example.com 43 seconds ago 5b490f30\n\u2502 Revision B\n\u25cb tylynnzk me@example.com 43 seconds ago f26967c8\n\u2502 Revision A\n
"},{"location":"FAQ/#how-can-i-get-jj-log-to-show-me-what-git-log-would-show-me","title":"How can I get jj log
to show me what git log
would show me?","text":"Use jj log -r ..
. The ..
operator lists all visible commits in the repo, excluding the root (which is never interesting and is shared by all repos).
"},{"location":"FAQ/#can-i-monitor-how-jj-log-evolves","title":"Can I monitor how jj log
evolves?","text":"The simplest way to monitor how the history as shown by jj log
evolves is by using the watch(1) command (or hwatch or viddy). For example:
watch --color jj --ignore-working-copy log --color=always\n
This will continuously update the (colored) log output in the terminal. The --ignore-working-copy
option avoids conflicts with manual operations during the creation of snapshots. Martin used watch in a tmux pane during his presentation Jujutsu - A Git-compatible VCS.
Alternatively, you can use jj-fzf, where the central piece is the jj log
view and common operations can be carried out via key bindings while the log view updates.
The wiki lists additional TUIs and GUIs beyond the terminal: GUI-and-TUI
"},{"location":"FAQ/#should-i-co-locate-my-repository","title":"Should I co-locate my repository?","text":"Co-locating a Jujutsu repository allows you to use both Jujutsu and Git in the same working copy. The benefits of doing so are:
-
You can use Git commands when you're not sure how to do something with Jujutsu, Jujutsu hasn't yet implemented a feature (e.g., bisection), or you simply prefer Git in some situations.
-
Tooling that expects a Git repository still works (IDEs, build tooling, etc.)
The co-location documentation describes the drawbacks but the most important ones are:
-
Interleaving git
and jj
commands may create confusing bookmark conflicts or divergent changes.
-
If the working copy commit or its parent contain any conflicted files, tools expecting a Git repo may interpret the commit contents or its diff in a wrong and confusing way. You should avoid doing mutating operations with Git tools and ignore the confusing information such tools present for conflicted commits (unless you are curious about the details of how jj
stores conflicts). See #3979 for plans to improve this situation.
-
Jujutsu commands may be a little slower in very large repositories due to importing and exporting changes to Git. Most repositories are not noticeably affected by this.
If you primarily use Jujutsu to modify the repository, the drawbacks are unlikely to affect you. Try co-locating while you learn Jujutsu, then switch if you find a specific reason not to co-locate.
"},{"location":"FAQ/#jj-is-said-to-record-the-working-copy-after-jj-log-and-every-other-command-where-can-i-see-these-automatic-saves","title":"jj
is said to record the working copy after jj log
and every other command. Where can I see these automatic \"saves\"?","text":"Indeed, every jj
command updates the current \"working-copy\" revision, marked with @
in jj log
. You can notice this by how the commit ID of the working copy revision changes when it's updated. Note that, unless you move to another revision (with jj new
or jj edit
, for example), the change ID will not change.
If you expected to see a historical view of your working copy changes in the parent-child relationships between commits you can see in jj log
, this is simply not what they mean. What you can see in jj log
is that after the working copy commit gets amended (after any edit), the commit ID changes.
You can see the actual history of working copy changes using jj evolog
. This will show the history of the commits that were previously the \"working-copy commit\", since the last time the change id of the working copy commit changed. The obsolete changes will be marked as \"hidden\". They are still accessible with any jj
command (jj diff
, for example), but you will need to use the commit id to refer to hidden commits.
You can also use jj evolog -r
on revisions that were previously the working-copy revisions (or on any other revisions). Use jj evolog -p
as an easy way to see the evolution of the commit's contents.
"},{"location":"FAQ/#can-i-prevent-jujutsu-from-recording-my-unfinished-work-im-not-ready-to-commit-it","title":"Can I prevent Jujutsu from recording my unfinished work? I'm not ready to commit it.","text":"Jujutsu automatically records new files in the current working-copy commit and doesn't provide a way to prevent that.
However, you can easily record intermediate drafts of your work. If you think you might want to go back to the current state of the working-copy commit, simply use jj new
. There's no need for the commit to be \"finished\" or even have a description.
Then future edits will go into a new working-copy commit on top of the now former working-copy commit. Whenever you are happy with another set of edits, use jj squash
to amend the previous commit.
If you have changes you never want to put in a public commit, see: How can I keep my scratch files in the repository without committing them?
For more options see the next question.
"},{"location":"FAQ/#can-i-interactively-create-a-new-commit-from-only-some-of-the-changes-in-the-working-copy-like-git-add-p-git-commit-or-hg-commit-i","title":"Can I interactively create a new commit from only some of the changes in the working copy, like git add -p && git commit
or hg commit -i
?","text":"Since the changes are already in the working-copy commit, the equivalent to git add -p && git commit
/git commit -p
/hg commit -i
is to split the working-copy commit with jj split -i
(or the practically identical jj commit -i
).
For the equivalent of git commit --amend -p
/hg amend -i
, use jj squash -i
.
"},{"location":"FAQ/#is-there-something-like-git-rebase-interactive-or-hg-histedit","title":"Is there something like git rebase --interactive
or hg histedit
?","text":"Not yet, you can check this issue for updates.
To reorder commits, it is for now recommended to rebase commits individually, which may require multiple invocations of jj rebase -r
or jj rebase -s
.
To squash or split commits, use jj squash
and jj split
.
"},{"location":"FAQ/#how-can-i-keep-my-scratch-files-in-the-repository-without-committing-them","title":"How can I keep my scratch files in the repository without committing them?","text":"You can set snapshot.auto-track
to only start tracking new files matching the configured pattern (e.g. \"none()\"
). Changes to already tracked files will still be snapshotted by every command.
You can keep your notes and other scratch files in the repository, if you add a wildcard pattern to either the repo's gitignore
or your global gitignore
. Something like *.scratch
or *.scratchpad
should do, after that rename the files you want to keep around to match the pattern.
If you keep your scratch files in their own directory with no tracked files, you can create a .gitignore
file in that directory containing only *
. This will ignore everything in the directory including the .gitignore
file itself.
If $EDITOR
integration is important, something like scratchpad.*
may be more helpful, as you can keep the filename extension intact (it matches scratchpad.md
, scratchpad.rs
and more). Another option is to add a directory to the global .gitignore
which then stores all your temporary files and notes. For example, you could add scratch/
to ~/.git/ignore
and then store arbitrary files in <your-git-repo>/scratch/
.
You can find more details on gitignore
files here.
"},{"location":"FAQ/#how-can-i-avoid-committing-my-local-only-changes-to-tracked-files","title":"How can I avoid committing my local-only changes to tracked files?","text":"Suppose your repository tracks a file like secret_config.json
, and you make some changes to that file to work locally. Since Jujutsu automatically commits the working copy, there's no way to prevent Jujutsu from committing changes to the file. But, you never want to push those changes to the remote repository.
One solution is to keep these changes in a separate commit branched from the trunk. To use those changes in your working copy, merge the private commit into your branch.
Suppose you have a commit \"Add new feature\":
$ jj log\n@ xxxxxxxx me@example.com 2024-08-21 11:13:21 ef612875\n\u2502 Add new feature\n\u25c9 yyyyyyyy me@example.com 2024-08-21 11:13:09 main b624cf12\n\u2502 Existing work\n~\n
First, create a new commit branched from main and add your private changes:
$ jj new main -m \"private: my credentials\"\nWorking copy now at: wwwwwwww 861de9eb (empty) private: my credentials\nParent commit : yyyyyyyy b624cf12 main | Existing work\nAdded 0 files, modified 1 files, removed 0 files\n\n$ echo '{ \"password\": \"p@ssw0rd1\" }' > secret_config.json\n
Now create a merge commit with the branch you're working on and the private commit:
$ jj new xxxxxxxx wwwwwwww\nWorking copy now at: vvvvvvvv ac4d9fbe (empty) (no description set)\nParent commit : xxxxxxxx ef612875 Add new feature\nParent commit : wwwwwwww 2106921e private: my credentials\nAdded 0 files, modified 1 files, removed 0 files\n\n$ jj log\n@ vvvvvvvv me@example.com 2024-08-22 08:57:40 ac4d9fbe\n\u251c\u2500\u256e (empty) (no description set)\n\u2502 \u25c9 wwwwwwww me@example.com 2024-08-22 08:57:40 2106921e\n\u2502 \u2502 private: my credentials\n\u25c9 \u2502 xxxxxxxx me@example.com 2024-08-21 11:13:21 ef612875\n\u251c\u2500\u256f Add new feature\n\u25c9 yyyyyyyy me@example.com 2024-08-21 11:13:09 main b624cf12\n\u2502 Existing work\n~\n
Now you're ready to work:
- Your work in progress xxxxxxxx is the first parent of the merge commit.
- The private commit wwwwwwww is the second parent of the merge commit.
- The working copy (vvvvvvvv) contains changes from both.
As you work, squash your changes using jj squash --into xxxxxxxx
.
If you need a new empty commit on top of xxxxxxxx
you can use the --insert-after
and --insert-before
options (-A
and -B
for short):
# Insert a new commit after xxxxxxxx\n$ jj new --no-edit -A xxxxxxxx -m \"Another feature\"\nWorking copy now at: uuuuuuuu 1c3cff09 (empty) Another feature\nParent commit : xxxxxxxx ef612875 Add new feature\n\n# Insert a new commit between yyyyyyyy and vvvvvvvv\n$ jj new --no-edit -A yyyyyyyy -B vvvvvvvv -m \"Yet another feature\"\nWorking copy now at: tttttttt 938ab831 (empty) Yet another feature\nParent commit : yyyyyyyy b624cf12 Existing work\n
To avoid pushing change wwwwwwww by mistake, use the configuration git.private-commits:
jj config set --user git.private-commits 'description(glob:\"private:*\")'\n
"},{"location":"FAQ/#i-accidentally-changed-files-in-the-wrong-commit-how-do-i-move-the-recent-changes-into-another-commit","title":"I accidentally changed files in the wrong commit, how do I move the recent changes into another commit?","text":"Use jj evolog -p
to see how your working-copy commit has evolved. Find the commit you want to restore the contents to. Let's say the current commit (with the changes intended for a new commit) are in commit X and the state you wanted is in commit Y. Note the commit id (normally in blue at the end of the line in the log output) of each of them. Now use jj new
to create a new working-copy commit, then run jj restore --from Y --into @-
to restore the parent commit to the old state, and jj restore --from X
to restore the new working-copy commit to the new state.
"},{"location":"FAQ/#how-do-i-resume-working-on-an-existing-change","title":"How do I resume working on an existing change?","text":"There are two ways to resume working on an earlier change: jj new
then jj squash
, and jj edit
. The first is generally recommended, but jj edit
can be useful. When you use jj edit
, the revision is directly amended with your new changes, making it difficult to tell what exactly you change. You should avoid using jj edit
when the revision has a conflict, as you may accidentally break the plain-text annotations on your state without realising.
To start, use jj new <rev>
to create a change based on that earlier revision. Make your edits, then use jj squash
to update the earlier revision with those edits. For when you would use git stashing, use jj edit <rev>
for expected behaviour. Other workflows may prefer jj edit
as well.
"},{"location":"FAQ/#why-are-most-merge-commits-marked-as-empty","title":"Why are most merge commits marked as \"(empty)\"?","text":"Jujutsu, like Git, is a snapshot-based VCS. That means that each commit logically records the state of all current files in the repo. The changes in a commit are not recorded but are instead calculated when needed by comparing the commit's state to the parent commit's state. Jujutsu defines the changes in a commit to be relative to the auto-merged parents (if there's only one parent, then that merge is trivial - it's the parent commit's state). As a result, a merge commit that was a clean merge (no conflict resolution, no additional changes) is considered empty. Conversely, if the merge commit contains conflict resolutions or additional changes, then it will be considered non-empty.
This definition of the changes in a commit is used throughout Jujutsu. It's used by jj diff -r
and jj log -p
to show the changes in a commit. It's used by jj rebase
to rebase the changes in a commit. It's used in jj log
to indicate which commits are empty. It's used in the files()
revset function (and by jj log <path>
) to find commits that modify a certain path. And so on.
"},{"location":"FAQ/#how-do-i-deal-with-divergent-changes-after-the-change-id","title":"How do I deal with divergent changes ('??' after the change ID)?","text":"A divergent change represents a change that has two or more visible commits associated with it. To refer to such commits, you must use their commit ID. Most commonly, the way to resolve this is to abandon the unneeded commits (using jj abandon <commit ID>
). If you would like to keep both commits with this change ID, you can jj duplicate
one of them before abandoning it.
"},{"location":"FAQ/#how-do-i-deal-with-conflicted-bookmarks-after-bookmark-name","title":"How do I deal with conflicted bookmarks ('??' after bookmark name)?","text":"A conflicted bookmark is a bookmark that refers to multiple different commits because jj couldn't fully resolve its desired position. Resolving conflicted bookmarks is usually done by setting the bookmark to the correct commit using jj bookmark move <name> --to <commit ID>
.
Usually, the different commits associated with the conflicted bookmark should all appear in the log, but if they don't you can use jj bookmark list
to show all the commits associated with it.
"},{"location":"FAQ/#how-do-i-integrate-jujutsu-with-gerrit","title":"How do I integrate Jujutsu with Gerrit?","text":"At the moment you'll need a script, which adds the required fields for Gerrit like the Change-Id
footer. Then jj
can invoke it via an $EDITOR
override in an aliased command. Here's an example from an contributor (look for the jj signoff
alias).
After you have attached the Change-Id:
footer to the commit series, you'll have to manually invoke git push
of HEAD
on the underlying git repository into the remote Gerrit bookmark refs/for/$BRANCH
, where $BRANCH
is the base bookmark you want your changes to go to (e.g., git push origin HEAD:refs/for/main
). Using a co-located repo will make the underlying git repo directly accessible from the working directory.
We hope to integrate with Gerrit natively in the future.
"},{"location":"FAQ/#i-want-to-write-a-tool-which-integrates-with-jujutsu-should-i-use-the-library-or-parse-the-cli","title":"I want to write a tool which integrates with Jujutsu. Should I use the library or parse the CLI?","text":"There are some trade-offs and there is no definitive answer yet.
- Using
jj-lib
avoids parsing command output and makes error handling easier. jj-lib
is not a stable API, so you may have to make changes to your tool when the API changes. - The CLI is not stable either, so you may need to make your tool detect the different versions and call the right command.
- Using the CLI means that your tool will work with custom-built
jj
binaries, like the one at Google (if you're using the library, you will not be able to detect custom backends and more).
"},{"location":"bookmarks/","title":"Bookmarks","text":""},{"location":"bookmarks/#introduction","title":"Introduction","text":"Bookmarks are named pointers to revisions (just like branches are in Git). You can move them without affecting the target revision's identity. Bookmarks automatically move when revisions are rewritten (e.g. by jj rebase
). You can pass a bookmark's name to commands that want a revision as argument. For example, jj new main
will create a new revision on top of the main
bookmark. Use jj bookmark list
to list bookmarks and jj bookmark <subcommand>
to create, move, or delete bookmarks. There is currently no concept of an active/current/checked-out bookmark.
"},{"location":"bookmarks/#mapping-to-git-branches","title":"Mapping to Git branches","text":"Jujutsu maps its bookmarks to Git branches when interacting with Git repos. For example, jj git push --bookmark foo
will push the state of the foo
bookmark to the foo
branch on the Git remote. Similarly, if you create a bar
branch in the backing Git repo, then a subsequent jj git import
will create a bar
bookmark (reminder: that import happens automatically in colocated repos).
"},{"location":"bookmarks/#remotes-and-tracked-bookmarks","title":"Remotes and tracked bookmarks","text":"Jujutsu records the last seen position of a bookmark on each remote (just like Git's remote-tracking branches). This record is updated on every jj git fetch
and jj git push
of the bookmark. You can refer to the remembered remote bookmark positions with <bookmark name>@<remote name>
, such as jj new main@origin
. jj
does not provide a way to manually edit these recorded positions.
A remote bookmark can be associated with a local bookmark of the same name. This is called a tracked remote bookmark (which maps to a Git remote branch when using the Git backend). When you pull a tracked bookmark from a remote, any changes compared to the current record of the remote's state will be propagated to the corresponding local bookmark, which will be created if it doesn't exist already.
Details: how fetch
pulls bookmarks
Let's say you run jj git fetch --remote origin
and, during the fetch, jj
determines that the remote's main
bookmark has been moved so that its target is now ahead of the local record in main@origin
.
jj
will then update main@origin
to the new target. If main@origin
is tracked, jj
will also apply the change to the local bookmark main
. If the local target has also been moved compared to main@origin
(probably because you ran jj bookmark set main
), then the two updates will be merged. If one is ahead of the other, then that target will become the new target. Otherwise, the local bookmark will become conflicted (see the \"Conflicts\" section below for details).
Most commands don't show the tracked remote bookmark if it has the same target as the local bookmark. The local bookmark (without @<remote name>
) is considered the bookmark's desired target. Consequently, if you want to update a bookmark on a remote, you first update the bookmark locally and then push the update to the remote. If a local bookmark also exists on some remote but points to a different target there, jj log
will show the bookmark name with an asterisk suffix (e.g. main*
). That is meant to remind you that you may want to push the bookmark to some remote.
If you want to know the internals of bookmark tracking, consult the Design Doc.
"},{"location":"bookmarks/#terminology-summary","title":"Terminology summary","text":" - A remote bookmark is a bookmark ref on the remote.
jj
can find out its actual state only when it's actively communicating with the remote. However, jj
does store the last-seen position of the remote bookmark; this is the commit jj show <bookmark name>@<remote name>
would show. This notion is completely analogous to Git's \"remote-tracking branches\". - A tracked (remote) bookmark is defined above. You can make a remote bookmark tracked with the
jj bookmark track
command, for example. - A tracking (local) bookmark is the local bookmark that
jj
tries to keep in sync with the tracked remote bookmark. For example, after jj bookmark track mybookmark@origin
, there will be a local bookmark mybookmark
that's tracking the remote mybookmark@origin
bookmark. A local bookmark can track a bookmark of the same name on 0 or more remotes.
The notion of tracked bookmarks serves a similar function to the Git notion of an \"upstream branch\". Unlike Git, a single local bookmark can be tracking remote bookmarks on multiple remotes, and the names of the local and remote bookmarks must match.
"},{"location":"bookmarks/#manually-tracking-a-bookmark","title":"Manually tracking a bookmark","text":"To track a bookmark permanently use jj bookmark track <bookmark name>@<remote name>
. It will now be imported as a local bookmark until you untrack it or it is deleted on the remote.
Example:
$ # List all available bookmarks, as we want our colleague's bookmark.\n$ jj bookmark list --all\n$ # Find the bookmark.\n$ # [...]\n$ # Actually track the bookmark.\n$ jj bookmark track <bookmark name>@<remote name> # Example: jj bookmark track my-feature@origin\n$ # From this point on, <bookmark name> will be imported when fetching from <remote name>.\n$ jj git fetch --remote <remote name>\n$ # A local bookmark <bookmark name> should have been created or updated while fetching.\n$ jj new <bookmark name> # Do some local testing, etc.\n
"},{"location":"bookmarks/#untracking-a-bookmark","title":"Untracking a bookmark","text":"To stop following a remote bookmark, you can jj bookmark untrack
it. After that, subsequent fetches of that remote will no longer move the local bookmark to match the position of the remote bookmark.
Example:
$ # List all local and remote bookmarks.\n$ jj bookmark list --all\n$ # Find the bookmark we no longer want to track.\n$ # [...]\n# # Actually untrack it.\n$ jj bookmark untrack <bookmark name>@<remote name> # Example: jj bookmark untrack stuff@origin\n$ # From this point on, this remote bookmark won't be imported anymore.\n$ # The local bookmark (e.g. stuff) is unaffected. It may or may not still\n$ # be tracking bookmarks on other remotes (e.g. stuff@upstream).\n
"},{"location":"bookmarks/#listing-tracked-bookmarks","title":"Listing tracked bookmarks","text":"To list tracked bookmarks, you can jj bookmark list --tracked
or jj bookmark list -t
. This command omits local Git-tracking bookmarks by default.
You can see if a specific bookmark is tracked with jj bookmark list --tracked <bookmark name>
.
"},{"location":"bookmarks/#automatic-tracking-of-bookmarks-gitauto-local-bookmark-option","title":"Automatic tracking of bookmarks & git.auto-local-bookmark
option","text":"There are two situations where jj
tracks bookmarks automatically. jj git clone
automatically sets up the default remote bookmark (e.g. main@origin
) as tracked. When you push a local bookmark, the newly created bookmark on the remote is marked as tracked.
By default, every other remote bookmark is marked as \"not tracked\" when it's fetched. If desired, you need to manually jj bookmark track
them. This works well for repositories where multiple people work on a large number of bookmarks.
The default can be changed by setting the config git.auto-local-bookmark = true
. Then, jj git fetch
tracks every newly fetched bookmark with a local bookmark. Branches that already existed before the jj git fetch
are not affected. This is similar to Mercurial, which fetches all its bookmarks (equivalent to Git's branches) by default.
"},{"location":"bookmarks/#bookmark-movement","title":"Bookmark movement","text":"Currently Jujutsu automatically moves local bookmarks when these conditions are met:
- When a commit has been rewritten (e.g, when you rebase) bookmarks and the working-copy will move along with it.
- When a commit has been abandoned, all associated bookmarks will be moved to its parent(s). If a working copy was pointing to the abandoned commit, then a new working-copy commit will be created on top of the parent(s).
You could describe the movement as following along the change-id of the current bookmark commit, even if it isn't entirely accurate.
"},{"location":"bookmarks/#pushing-bookmarks-safety-checks","title":"Pushing bookmarks: Safety checks","text":"Before jj git push
actually moves, creates, or deletes a remote bookmark, it makes several safety checks.
-
jj
will contact the remote and check that the actual state of the remote bookmark matches jj
's record of its last known position. If there is a conflict, jj
will refuse to push the bookmark. In this case, you need to run jj git fetch --remote <remote name>
and resolve the resulting bookmark conflict. Then, you can try jj git push
again.
If you are familiar with Git, this makes jj git push
similar to git push --force-with-lease
.
There are a few cases where jj git push
will succeed even though the remote bookmark is in an unexpected location. These are the cases where jj git fetch
would not create a bookmark conflict and would not move the local bookmark, e.g. if the unexpected location is identical to the local position of the bookmark.
-
The local bookmark must not be conflicted. If it is, you would need to use jj bookmark move
, for example, to resolve the conflict.
This makes jj git push
safe even if jj git fetch
is performed on a timer in the background (this situation is a known issue1 with some forms of git push --force-with-lease
). If the bookmark moves on a remote in a problematic way, jj git fetch
will create a conflict. This should ensure that the user becomes aware of the conflict before they can jj git push
and override the bookmark on the remote.
-
If the remote bookmark already exists on the remote, it must be tracked. If the bookmark does not already exist on the remote, there is no problem; jj git push --allow-new
will create the remote bookmark and mark it as tracked.
"},{"location":"bookmarks/#conflicts","title":"Conflicts","text":"Bookmarks can end up in a conflicted state. When that happens, jj status
will include information about the conflicted bookmarks (and instructions for how to mitigate it). jj bookmark list
will have details. jj log
will show the bookmark name with a double question mark suffix (e.g. main??
) on each of the conflicted bookmark's potential target revisions. Using the bookmark name to look up a revision will resolve to all potential targets. That means that jj new main
will error out, complaining that the revset resolved to multiple revisions.
Both local bookmarks (e.g. main
) and the remote bookmark (e.g. main@origin
) can have conflicts. Both can end up in that state if concurrent operations were run in the repo. The local bookmark more typically becomes conflicted because it was updated both locally and on a remote.
To resolve a conflicted state in a local bookmark (e.g. main
), you can move the bookmark to the desired target with jj bookmark move
. You may want to first either merge the conflicted targets with jj new
(e.g. jj new 'all:main'
), or you may want to rebase one side on top of the other with jj rebase
.
To resolve a conflicted state in a remote bookmark (e.g. main@origin
), simply pull from the remote (e.g. jj git fetch
). The conflict resolution will also propagate to the local bookmark (which was presumably also conflicted).
"},{"location":"bookmarks/#ease-of-use","title":"Ease of use","text":"The use of bookmarks is frequent in some workflows, for example, when interacting with Git repositories containing branches. To this end, one-letter shortcuts have been implemented, both for the jj bookmark
command itself through an alias (as jj b
), and for its subcommands. For example, jj bookmark create BOOKMARK-NAME
can be abbreviated as jj b c BOOKMARK-NAME
.
-
See \"A general note on safety\" in https://git-scm.com/docs/git-push#Documentation/git-push.txt---no-force-with-lease \u21a9
"},{"location":"cli-reference/","title":"CLI Reference","text":"Warning
This CLI reference is experimental. It is automatically generated, but does not match the jj help
output exactly.
Run jj help <COMMAND>
for more authoritative documentation.
If you see a significant difference, feel free to file a bug, or a PR to note the difference here.
"},{"location":"cli-reference/#command-line-help-for-jj","title":"Command-Line Help for jj
","text":"This document contains the help content for the jj
command-line program.
Command Overview:
jj
\u21b4 jj abandon
\u21b4 jj absorb
\u21b4 jj backout
\u21b4 jj bookmark
\u21b4 jj bookmark create
\u21b4 jj bookmark delete
\u21b4 jj bookmark forget
\u21b4 jj bookmark list
\u21b4 jj bookmark move
\u21b4 jj bookmark rename
\u21b4 jj bookmark set
\u21b4 jj bookmark track
\u21b4 jj bookmark untrack
\u21b4 jj commit
\u21b4 jj config
\u21b4 jj config edit
\u21b4 jj config get
\u21b4 jj config list
\u21b4 jj config path
\u21b4 jj config set
\u21b4 jj config unset
\u21b4 jj describe
\u21b4 jj diff
\u21b4 jj diffedit
\u21b4 jj duplicate
\u21b4 jj edit
\u21b4 jj evolog
\u21b4 jj file
\u21b4 jj file annotate
\u21b4 jj file chmod
\u21b4 jj file list
\u21b4 jj file show
\u21b4 jj file track
\u21b4 jj file untrack
\u21b4 jj fix
\u21b4 jj git
\u21b4 jj git clone
\u21b4 jj git export
\u21b4 jj git fetch
\u21b4 jj git import
\u21b4 jj git init
\u21b4 jj git push
\u21b4 jj git remote
\u21b4 jj git remote add
\u21b4 jj git remote list
\u21b4 jj git remote remove
\u21b4 jj git remote rename
\u21b4 jj git remote set-url
\u21b4 jj help
\u21b4 jj init
\u21b4 jj interdiff
\u21b4 jj log
\u21b4 jj new
\u21b4 jj next
\u21b4 jj operation
\u21b4 jj operation abandon
\u21b4 jj operation diff
\u21b4 jj operation log
\u21b4 jj operation restore
\u21b4 jj operation show
\u21b4 jj operation undo
\u21b4 jj parallelize
\u21b4 jj prev
\u21b4 jj rebase
\u21b4 jj resolve
\u21b4 jj restore
\u21b4 jj root
\u21b4 jj show
\u21b4 jj simplify-parents
\u21b4 jj sparse
\u21b4 jj sparse edit
\u21b4 jj sparse list
\u21b4 jj sparse reset
\u21b4 jj sparse set
\u21b4 jj split
\u21b4 jj squash
\u21b4 jj status
\u21b4 jj tag
\u21b4 jj tag list
\u21b4 jj util
\u21b4 jj util completion
\u21b4 jj util config-schema
\u21b4 jj util exec
\u21b4 jj util gc
\u21b4 jj util install-man-pages
\u21b4 jj util markdown-help
\u21b4 jj undo
\u21b4 jj version
\u21b4 jj workspace
\u21b4 jj workspace add
\u21b4 jj workspace forget
\u21b4 jj workspace list
\u21b4 jj workspace rename
\u21b4 jj workspace root
\u21b4 jj workspace update-stale
\u21b4
"},{"location":"cli-reference/#jj","title":"jj
","text":"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' lists available keywords. Use 'jj help -k' to show help for one of these keywords.
"},{"location":"cli-reference/#subcommands","title":"Subcommands:","text":" abandon
\u2014 Abandon a revision absorb
\u2014 Move changes from a revision into the stack of mutable revisions backout
\u2014 Apply the reverse of a revision on top of another revision bookmark
\u2014 Manage bookmarks [default alias: b] commit
\u2014 Update the description and create a new change on top config
\u2014 Manage config options describe
\u2014 Update the change description or other metadata diff
\u2014 Compare file contents between two revisions diffedit
\u2014 Touch up the content changes in a revision with a diff editor duplicate
\u2014 Create new changes with the same content as existing ones edit
\u2014 Sets the specified revision as the working-copy revision evolog
\u2014 Show how a change has evolved over time file
\u2014 File operations fix
\u2014 Update files with formatting fixes or other changes git
\u2014 Commands for working with Git remotes and the underlying Git repo help
\u2014 Print this message or the help of the given subcommand(s) init
\u2014 Create a new repo in the given directory interdiff
\u2014 Compare the changes of two commits log
\u2014 Show revision history new
\u2014 Create a new, empty change and (by default) edit it in the working copy next
\u2014 Move the working-copy commit to the child revision operation
\u2014 Commands for working with the operation log parallelize
\u2014 Parallelize revisions by making them siblings prev
\u2014 Change the working copy revision relative to the parent revision rebase
\u2014 Move revisions to different parent(s) resolve
\u2014 Resolve conflicted files with an external merge tool restore
\u2014 Restore paths from another revision root
\u2014 Show the current workspace root directory show
\u2014 Show commit description and changes in a revision simplify-parents
\u2014 Simplify parent edges for the specified revision(s) sparse
\u2014 Manage which paths from the working-copy commit are present in the working copy split
\u2014 Split a revision in two squash
\u2014 Move changes from a revision into another revision status
\u2014 Show high-level repo status tag
\u2014 Manage tags util
\u2014 Infrequently used commands such as for generating shell completions undo
\u2014 Undo an operation (shortcut for jj op undo
) version
\u2014 Display version information workspace
\u2014 Commands for working with workspaces
"},{"location":"cli-reference/#options","title":"Options:","text":" -
-R
, --repository <REPOSITORY>
\u2014 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
\u2014 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
\u2014 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>
\u2014 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
\u2014 Enable debug logging
-
--color <WHEN>
\u2014 When to colorize output
Possible values: always
, never
, debug
, auto
-
--quiet
\u2014 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
\u2014 Disable the pager
-
--config <NAME=VALUE>
\u2014 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>
\u2014 Additional configuration files (can be repeated)
"},{"location":"cli-reference/#jj-abandon","title":"jj abandon
","text":"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]...
"},{"location":"cli-reference/#arguments","title":"Arguments:","text":" <REVSETS>
\u2014 The revision(s) to abandon (default: @)
"},{"location":"cli-reference/#options_1","title":"Options:","text":" -s
, --summary
\u2014 Do not print every abandoned commit on a separate line -
--retain-bookmarks
\u2014 Do not delete bookmarks pointing to the revisions to abandon
Bookmarks will be moved to the parent revisions instead.
-
--restore-descendants
\u2014 Do not modify the content of the children of the abandoned commits
"},{"location":"cli-reference/#jj-absorb","title":"jj absorb
","text":"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 source revision will be abandoned if all changes are absorbed into the destination revisions, and if the source revision has no description.
The modification made by jj absorb
can be reviewed by jj op show -p
.
Usage: jj absorb [OPTIONS] [FILESETS]...
"},{"location":"cli-reference/#arguments_1","title":"Arguments:","text":" <FILESETS>
\u2014 Move only changes to these paths (instead of all paths)
"},{"location":"cli-reference/#options_2","title":"Options:","text":" -
-f
, --from <REVSET>
\u2014 Source revision to absorb from
Default value: @
-
-t
, --into <REVSETS>
\u2014 Destination revisions to absorb into
Only ancestors of the source revision will be considered.
Default value: mutable()
"},{"location":"cli-reference/#jj-backout","title":"jj backout
","text":"Apply the reverse of a revision on top of another revision
Usage: jj backout [OPTIONS]
"},{"location":"cli-reference/#options_3","title":"Options:","text":" -
-r
, --revisions <REVSETS>
\u2014 The revision(s) to apply the reverse of
Default value: @
-
-d
, --destination <REVSETS>
\u2014 The revision to apply the reverse changes on top of
Default value: @
"},{"location":"cli-reference/#jj-bookmark","title":"jj bookmark
","text":"Manage bookmarks [default alias: b]
See the bookmark documentation for more information.
Usage: jj bookmark <COMMAND>
"},{"location":"cli-reference/#subcommands_1","title":"Subcommands:","text":" create
\u2014 Create a new bookmark delete
\u2014 Delete an existing bookmark and propagate the deletion to remotes on the next push forget
\u2014 Forget everything about a bookmark, including its local and remote targets list
\u2014 List bookmarks and their targets move
\u2014 Move existing bookmarks to target revision rename
\u2014 Rename old
bookmark name to new
bookmark name set
\u2014 Create or update a bookmark to point to a certain commit track
\u2014 Start tracking given remote bookmarks untrack
\u2014 Stop tracking given remote bookmarks
"},{"location":"cli-reference/#jj-bookmark-create","title":"jj bookmark create
","text":"Create a new bookmark
Usage: jj bookmark create [OPTIONS] <NAMES>...
"},{"location":"cli-reference/#arguments_2","title":"Arguments:","text":" <NAMES>
\u2014 The bookmarks to create
"},{"location":"cli-reference/#options_4","title":"Options:","text":" -r
, --revision <REVSET>
\u2014 The bookmark's target revision
"},{"location":"cli-reference/#jj-bookmark-delete","title":"jj bookmark delete
","text":"Delete an existing bookmark and propagate the deletion to remotes on the next push
Revisions referred to by the deleted bookmarks are not abandoned. To delete revisions as well as bookmarks, use jj abandon
. For example, jj abandon main..<bookmark>
will abandon revisions belonging to the <bookmark>
branch (relative to the main
branch.)
Usage: jj bookmark delete <NAMES>...
"},{"location":"cli-reference/#arguments_3","title":"Arguments:","text":" -
<NAMES>
\u2014 The bookmarks to delete
By default, the specified name matches exactly. Use glob:
prefix to select bookmarks by wildcard pattern.
"},{"location":"cli-reference/#jj-bookmark-forget","title":"jj bookmark forget
","text":"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>...
"},{"location":"cli-reference/#arguments_4","title":"Arguments:","text":" -
<NAMES>
\u2014 The bookmarks to forget
By default, the specified name matches exactly. Use glob:
prefix to select bookmarks by wildcard pattern.
"},{"location":"cli-reference/#jj-bookmark-list","title":"jj bookmark list
","text":"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 \"+\".
See the bookmark documentation for more information.
Usage: jj bookmark list [OPTIONS] [NAMES]...
"},{"location":"cli-reference/#arguments_5","title":"Arguments:","text":" -
<NAMES>
\u2014 Show bookmarks whose local name matches
By default, the specified name matches exactly. Use glob:
prefix to select bookmarks by wildcard pattern.
"},{"location":"cli-reference/#options_5","title":"Options:","text":" -a
, --all-remotes
\u2014 Show all tracking and non-tracking remote bookmarks including the ones whose targets are synchronized with the local bookmarks -
--remote <REMOTE>
\u2014 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.
-
-t
, --tracked
\u2014 Show remote tracked bookmarks only. Omits local Git-tracking bookmarks by default
-c
, --conflicted
\u2014 Show conflicted bookmarks only -
-r
, --revisions <REVSETS>
\u2014 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>
\u2014 Render each bookmark using the given template
All 0-argument methods of the [RefName
type] are available as keywords in the template expression.
"},{"location":"cli-reference/#jj-bookmark-move","title":"jj bookmark move
","text":"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>
"},{"location":"cli-reference/#arguments_6","title":"Arguments:","text":" -
<NAMES>
\u2014 Move bookmarks matching the given name patterns
By default, the specified name matches exactly. Use glob:
prefix to select bookmarks by wildcard pattern.
"},{"location":"cli-reference/#options_6","title":"Options:","text":" --from <REVSETS>
\u2014 Move bookmarks from the given revisions -
--to <REVSET>
\u2014 Move bookmarks to this revision
Default value: @
-
-B
, --allow-backwards
\u2014 Allow moving bookmarks backwards or sideways
"},{"location":"cli-reference/#jj-bookmark-rename","title":"jj bookmark rename
","text":"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>
"},{"location":"cli-reference/#arguments_7","title":"Arguments:","text":" <OLD>
\u2014 The old name of the bookmark <NEW>
\u2014 The new name of the bookmark
"},{"location":"cli-reference/#jj-bookmark-set","title":"jj bookmark set
","text":"Create or update a bookmark to point to a certain commit
Usage: jj bookmark set [OPTIONS] <NAMES>...
"},{"location":"cli-reference/#arguments_8","title":"Arguments:","text":" <NAMES>
\u2014 The bookmarks to update
"},{"location":"cli-reference/#options_7","title":"Options:","text":" -r
, --revision <REVSET>
\u2014 The bookmark's target revision -B
, --allow-backwards
\u2014 Allow moving the bookmark backwards or sideways
"},{"location":"cli-reference/#jj-bookmark-track","title":"jj bookmark track
","text":"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>...
"},{"location":"cli-reference/#arguments_9","title":"Arguments:","text":" -
<BOOKMARK@REMOTE>
\u2014 Remote bookmarks to track
By default, the specified name matches exactly. Use glob:
prefix to select bookmarks by wildcard pattern.
Examples: bookmark@remote, glob:main@, glob:jjfan-@upstream
"},{"location":"cli-reference/#jj-bookmark-untrack","title":"jj bookmark untrack
","text":"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>...
"},{"location":"cli-reference/#arguments_10","title":"Arguments:","text":" -
<BOOKMARK@REMOTE>
\u2014 Remote bookmarks to untrack
By default, the specified name matches exactly. Use glob:
prefix to select bookmarks by wildcard pattern.
Examples: bookmark@remote, glob:main@, glob:jjfan-@upstream
"},{"location":"cli-reference/#jj-commit","title":"jj commit
","text":"Update the description and create a new change on top
Usage: jj commit [OPTIONS] [FILESETS]...
"},{"location":"cli-reference/#arguments_11","title":"Arguments:","text":" <FILESETS>
\u2014 Put these paths in the first commit
"},{"location":"cli-reference/#options_8","title":"Options:","text":" -i
, --interactive
\u2014 Interactively choose which changes to include in the first commit --tool <NAME>
\u2014 Specify diff editor to be used (implies --interactive) -m
, --message <MESSAGE>
\u2014 The change description to use (don't open editor) -
--reset-author
\u2014 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' JJ_EMAIL=foo@bar.com jj commit --reset-author
-
--author <AUTHOR>
\u2014 Set author to the provided string
This changes author name and email while retaining author timestamp for non-discardable commits.
"},{"location":"cli-reference/#jj-config","title":"jj config
","text":"Manage config options
Operates on jj configuration, which comes from the config file and environment variables.
See the config documentation for file locations, supported config options, and other details about jj config
.
Usage: jj config <COMMAND>
"},{"location":"cli-reference/#subcommands_2","title":"Subcommands:","text":" edit
\u2014 Start an editor on a jj config file get
\u2014 Get the value of a given config option. list
\u2014 List variables set in config file, along with their values path
\u2014 Print the path to the config file set
\u2014 Update config file to set the given option to a given value unset
\u2014 Update config file to unset the given option
"},{"location":"cli-reference/#jj-config-edit","title":"jj config edit
","text":"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>
"},{"location":"cli-reference/#options_9","title":"Options:","text":" --user
\u2014 Target the user-level config --repo
\u2014 Target the repo-level config
"},{"location":"cli-reference/#jj-config-get","title":"jj config get
","text":"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>
"},{"location":"cli-reference/#arguments_12","title":"Arguments:","text":""},{"location":"cli-reference/#jj-config-list","title":"jj config list
","text":"List variables set in config file, along with their values
Usage: jj config list [OPTIONS] [NAME]
"},{"location":"cli-reference/#arguments_13","title":"Arguments:","text":" <NAME>
\u2014 An optional name of a specific config option to look up
"},{"location":"cli-reference/#options_10","title":"Options:","text":" --include-defaults
\u2014 Whether to explicitly include built-in default values in the list --include-overridden
\u2014 Allow printing overridden values --user
\u2014 Target the user-level config --repo
\u2014 Target the repo-level config -
-T
, --template <TEMPLATE>
\u2014 Render each variable using the given template
The following keywords are available in the template expression:
name: String
: Config name. value: ConfigValue
: Value to be formatted in TOML syntax. overridden: Boolean
: True if the value is shadowed by other.
"},{"location":"cli-reference/#jj-config-path","title":"jj config path
","text":"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>
"},{"location":"cli-reference/#options_11","title":"Options:","text":" --user
\u2014 Target the user-level config --repo
\u2014 Target the repo-level config
"},{"location":"cli-reference/#jj-config-set","title":"jj config set
","text":"Update config file to set the given option to a given value
Usage: jj config set <--user|--repo> <NAME> <VALUE>
"},{"location":"cli-reference/#arguments_14","title":"Arguments:","text":" <NAME>
-
<VALUE>
\u2014 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.
"},{"location":"cli-reference/#options_12","title":"Options:","text":" --user
\u2014 Target the user-level config --repo
\u2014 Target the repo-level config
"},{"location":"cli-reference/#jj-config-unset","title":"jj config unset
","text":"Update config file to unset the given option
Usage: jj config unset <--user|--repo> <NAME>
"},{"location":"cli-reference/#arguments_15","title":"Arguments:","text":""},{"location":"cli-reference/#options_13","title":"Options:","text":" --user
\u2014 Target the user-level config --repo
\u2014 Target the repo-level config
"},{"location":"cli-reference/#jj-describe","title":"jj describe
","text":"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]...
"},{"location":"cli-reference/#arguments_16","title":"Arguments:","text":" <REVSETS>
\u2014 The revision(s) whose description to edit (default: @)
"},{"location":"cli-reference/#options_14","title":"Options:","text":" -
-m
, --message <MESSAGE>
\u2014 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
\u2014 Read the change description from stdin
If multiple revisions are specified, the same description will be used for all of them.
-
--no-edit
\u2014 Don't open an editor
This is mainly useful in combination with e.g. --reset-author
.
-
--edit
\u2014 Open an editor
Forces an editor to open when using --stdin
or --message
to allow the message to be edited afterwards.
-
--reset-author
\u2014 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' JJ_EMAIL=foo@bar.com jj describe --reset-author
-
--author <AUTHOR>
\u2014 Set author to the provided string
This changes author name and email while retaining author timestamp for non-discardable commits.
"},{"location":"cli-reference/#jj-diff","title":"jj diff
","text":"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]...
"},{"location":"cli-reference/#arguments_17","title":"Arguments:","text":" <FILESETS>
\u2014 Restrict the diff to these paths
"},{"location":"cli-reference/#options_15","title":"Options:","text":" -
-r
, --revision <REVSET>
\u2014 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>
\u2014 Show changes from this revision
-t
, --to <REVSET>
\u2014 Show changes to this revision -s
, --summary
\u2014 For each path, show only whether it was modified, added, or deleted --stat
\u2014 Show a histogram of the changes -
--types
\u2014 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
\u2014 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
\u2014 Show a Git-format diff
--color-words
\u2014 Show a word-level diff with changes indicated only by color --tool <TOOL>
\u2014 Generate diff by external command --context <CONTEXT>
\u2014 Number of lines of context to show -w
, --ignore-all-space
\u2014 Ignore whitespace when comparing lines -b
, --ignore-space-change
\u2014 Ignore changes in amount of whitespace when comparing lines
"},{"location":"cli-reference/#jj-diffedit","title":"jj diffedit
","text":"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.
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]
"},{"location":"cli-reference/#options_16","title":"Options:","text":" -
-r
, --revision <REVSET>
\u2014 The revision to touch up
Defaults to @ if neither --to nor --from are specified.
-
-f
, --from <REVSET>
\u2014 Show changes from this revision
Defaults to @ if --to is specified.
-
-t
, --to <REVSET>
\u2014 Edit changes in this revision
Defaults to @ if --from is specified.
-
--tool <NAME>
\u2014 Specify diff editor to be used
-
--restore-descendants
\u2014 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.
"},{"location":"cli-reference/#jj-duplicate","title":"jj duplicate
","text":"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]...
"},{"location":"cli-reference/#arguments_18","title":"Arguments:","text":" <REVSETS>
\u2014 The revision(s) to duplicate (default: @)
"},{"location":"cli-reference/#options_17","title":"Options:","text":" -d
, --destination <REVSETS>
\u2014 The revision(s) to duplicate onto (can be repeated to create a merge commit) -A
, --insert-after <REVSETS>
\u2014 The revision(s) to insert after (can be repeated to create a merge commit) -B
, --insert-before <REVSETS>
\u2014 The revision(s) to insert before (can be repeated to create a merge commit)
"},{"location":"cli-reference/#jj-edit","title":"jj edit
","text":"Sets the specified revision as the working-copy revision
Note: it is generally recommended to instead use jj new
and jj squash
.
Usage: jj edit <REVSET>
"},{"location":"cli-reference/#arguments_19","title":"Arguments:","text":" <REVSET>
\u2014 The commit to edit
"},{"location":"cli-reference/#jj-evolog","title":"jj evolog
","text":"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]
"},{"location":"cli-reference/#options_18","title":"Options:","text":" -
-r
, --revision <REVSET>
Default value: @
-
-n
, --limit <LIMIT>
\u2014 Limit number of revisions to show
Applied after revisions are reordered topologically, but before being reversed.
-
--reversed
\u2014 Show revisions in the opposite order (older revisions first)
--no-graph
\u2014 Don't show the graph, show a flat list of revisions -
-T
, --template <TEMPLATE>
\u2014 Render each revision using the given template
Run jj log -T
to list the built-in templates.
You can also specify arbitrary [template expressions] using the built-in keywords.
-
-p
, --patch
\u2014 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
\u2014 For each path, show only whether it was modified, added, or deleted
--stat
\u2014 Show a histogram of the changes -
--types
\u2014 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
\u2014 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
\u2014 Show a Git-format diff
--color-words
\u2014 Show a word-level diff with changes indicated only by color --tool <TOOL>
\u2014 Generate diff by external command --context <CONTEXT>
\u2014 Number of lines of context to show --ignore-all-space
\u2014 Ignore whitespace when comparing lines --ignore-space-change
\u2014 Ignore changes in amount of whitespace when comparing lines
"},{"location":"cli-reference/#jj-file","title":"jj file
","text":"File operations
Usage: jj file <COMMAND>
"},{"location":"cli-reference/#subcommands_3","title":"Subcommands:","text":" annotate
\u2014 Show the source change for each line of the target file chmod
\u2014 Sets or removes the executable bit for paths in the repo list
\u2014 List files in a revision show
\u2014 Print contents of files in a revision track
\u2014 Start tracking specified paths in the working copy untrack
\u2014 Stop tracking specified paths in the working copy
"},{"location":"cli-reference/#jj-file-annotate","title":"jj file annotate
","text":"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>
"},{"location":"cli-reference/#arguments_20","title":"Arguments:","text":" <PATH>
\u2014 the file to annotate
"},{"location":"cli-reference/#options_19","title":"Options:","text":" -r
, --revision <REVSET>
\u2014 an optional revision to start at
"},{"location":"cli-reference/#jj-file-chmod","title":"jj file chmod
","text":"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>...
"},{"location":"cli-reference/#arguments_21","title":"Arguments:","text":""},{"location":"cli-reference/#options_20","title":"Options:","text":""},{"location":"cli-reference/#jj-file-list","title":"jj file list
","text":"List files in a revision
Usage: jj file list [OPTIONS] [FILESETS]...
"},{"location":"cli-reference/#arguments_22","title":"Arguments:","text":" <FILESETS>
\u2014 Only list files matching these prefixes (instead of all files)
"},{"location":"cli-reference/#options_21","title":"Options:","text":" -
-r
, --revision <REVSET>
\u2014 The revision to list files in
Default value: @
-
-T
, --template <TEMPLATE>
\u2014 Render each file entry using the given template
All 0-argument methods of the [TreeEntry
type] are available as keywords in the template expression.
"},{"location":"cli-reference/#jj-file-show","title":"jj file show
","text":"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>...
"},{"location":"cli-reference/#arguments_23","title":"Arguments:","text":" <FILESETS>
\u2014 Paths to print
"},{"location":"cli-reference/#options_22","title":"Options:","text":""},{"location":"cli-reference/#jj-file-track","title":"jj file track
","text":"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>...
"},{"location":"cli-reference/#arguments_24","title":"Arguments:","text":" <FILESETS>
\u2014 Paths to track
"},{"location":"cli-reference/#jj-file-untrack","title":"jj file untrack
","text":"Stop tracking specified paths in the working copy
Usage: jj file untrack <FILESETS>...
"},{"location":"cli-reference/#arguments_25","title":"Arguments:","text":""},{"location":"cli-reference/#jj-fix","title":"jj fix
","text":"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. enabled
: Enables or disables the tool. If omitted, the tool is enabled. This is useful for defining disabled tools in user configuration that can be enabled in individual repositories with one config setting.
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
):
[fix.tools.clang-format]\ncommand = [\"/usr/bin/clang-format\", \"--assume-filename=$path\"]\npatterns = [\"glob:'**/*.cc'\",\n \"glob:'**/*.h'\"]\n\n[fix.tools.black]\ncommand = [\"/usr/bin/black\", \"-\", \"--stdin-filename=$path\"]\npatterns = [\"glob:'**/*.py'\"]\n
Execution order of tools that affect the same file is deterministic, but currently unspecified, and may change between releases. If two tools affect the same file, the second tool to run will receive its input from the output of the first tool.
Usage: jj fix [OPTIONS] [FILESETS]...
"},{"location":"cli-reference/#arguments_26","title":"Arguments:","text":" <FILESETS>
\u2014 Fix only these paths
"},{"location":"cli-reference/#options_23","title":"Options:","text":" -s
, --source <REVSETS>
\u2014 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 --include-unchanged-files
\u2014 Fix unchanged files in addition to changed ones. If no paths are specified, all files in the repo will be fixed
"},{"location":"cli-reference/#jj-git","title":"jj git
","text":"Commands for working with Git remotes and the underlying Git repo
See this comparison, including a table of commands.
Usage: jj git <COMMAND>
"},{"location":"cli-reference/#subcommands_4","title":"Subcommands:","text":" clone
\u2014 Create a new repo backed by a clone of a Git repo export
\u2014 Update the underlying Git repo with changes made in the repo fetch
\u2014 Fetch from a Git remote import
\u2014 Update repo with changes made in the underlying Git repo init
\u2014 Create a new Git backed repo push
\u2014 Push to a Git remote remote
\u2014 Manage Git remotes
"},{"location":"cli-reference/#jj-git-clone","title":"jj git clone
","text":"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] <SOURCE> [DESTINATION]
"},{"location":"cli-reference/#arguments_27","title":"Arguments:","text":" -
<SOURCE>
\u2014 URL or path of the Git repo to clone
Local path will be resolved to absolute form.
-
<DESTINATION>
\u2014 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
"},{"location":"cli-reference/#options_24","title":"Options:","text":""},{"location":"cli-reference/#jj-git-export","title":"jj git export
","text":"Update the underlying Git repo with changes made in the repo
Usage: jj git export
"},{"location":"cli-reference/#jj-git-fetch","title":"jj git fetch
","text":"Fetch from a Git remote
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 git fetch [OPTIONS]
"},{"location":"cli-reference/#options_25","title":"Options:","text":" -
-b
, --branch <BRANCH>
\u2014 Fetch only some of the branches
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.
Default value: glob:*
-
--remote <REMOTE>
\u2014 The remote to fetch from (only named remotes are supported, can be repeated)
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.
-
--all-remotes
\u2014 Fetch from all remotes
"},{"location":"cli-reference/#jj-git-import","title":"jj git import
","text":"Update repo with changes made in the underlying Git repo
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 git import
"},{"location":"cli-reference/#jj-git-init","title":"jj git init
","text":"Create a new Git backed repo
Usage: jj git init [OPTIONS] [DESTINATION]
"},{"location":"cli-reference/#arguments_28","title":"Arguments:","text":" -
<DESTINATION>
\u2014 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.
By default the git
repo is under $destination/.jj
Default value: .
"},{"location":"cli-reference/#options_26","title":"Options:","text":" -
--colocate
\u2014 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.
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.
This option is mutually exclusive with --git-repo
.
-
--git-repo <GIT_REPO>
\u2014 Specifies a path to an existing git repository to be used as the backing git repo for the newly created jj
repo.
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.
This option is mutually exclusive with --colocate
.
"},{"location":"cli-reference/#jj-git-push","title":"jj git push
","text":"Push to a Git remote
By 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.
Unlike in Git, the remote to push to is not derived from the tracked remote bookmarks. Use --remote
to select the remote Git repository by name. There is no option to push to multiple remotes.
Before the command actually moves, creates, or deletes a remote bookmark, it makes several [safety checks]. If there is a problem, you may need to run jj git fetch --remote <remote name>
and/or resolve some [bookmark conflicts].
[safety checks]: https://jj-vcs.github.io/jj/latest/bookmarks/#pushing-bookmarks-safety-checks [bookmark conflicts]: https://jj-vcs.github.io/jj/latest/bookmarks/#conflicts
Usage: jj git push [OPTIONS]
"},{"location":"cli-reference/#options_27","title":"Options:","text":" -
--remote <REMOTE>
\u2014 The remote to push to (only named remotes are supported)
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.
-
-b
, --bookmark <BOOKMARK>
\u2014 Push only this bookmark, or bookmarks matching a pattern (can be repeated)
By default, the specified name matches exactly. Use glob:
prefix to select bookmarks by wildcard pattern.
-
--all
\u2014 Push all bookmarks (including new and deleted bookmarks)
-
--tracked
\u2014 Push all tracked bookmarks (including deleted bookmarks)
This usually means that the bookmark was already pushed to or fetched from the relevant remote.
-
--deleted
\u2014 Push all deleted bookmarks
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.
-
-N
, --allow-new
\u2014 Allow pushing new bookmarks
Newly-created remote bookmarks will be tracked automatically.
This can also be turned on by the git.push-new-bookmarks
setting. If it's set to true
, --allow-new
is no-op.
-
--allow-empty-description
\u2014 Allow pushing commits with empty descriptions
-
--allow-private
\u2014 Allow pushing commits that are private
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.
-
-r
, --revisions <REVSETS>
\u2014 Push bookmarks pointing to these commits (can be repeated)
-
-c
, --change <REVSETS>
\u2014 Push this commit by creating a bookmark based on its change ID (can be repeated)
The created bookmark will be tracked automatically. Use the git.push-bookmark-prefix
setting to change the prefix for generated names.
-
--dry-run
\u2014 Only display what will change on the remote
"},{"location":"cli-reference/#jj-git-remote","title":"jj git remote
","text":"Manage Git remotes
The Git repo will be a bare git repo stored inside the .jj/
directory.
Usage: jj git remote <COMMAND>
"},{"location":"cli-reference/#subcommands_5","title":"Subcommands:","text":" add
\u2014 Add a Git remote list
\u2014 List Git remotes remove
\u2014 Remove a Git remote and forget its bookmarks rename
\u2014 Rename a Git remote set-url
\u2014 Set the URL of a Git remote
"},{"location":"cli-reference/#jj-git-remote-add","title":"jj git remote add
","text":"Add a Git remote
Usage: jj git remote add <REMOTE> <URL>
"},{"location":"cli-reference/#arguments_29","title":"Arguments:","text":""},{"location":"cli-reference/#jj-git-remote-list","title":"jj git remote list
","text":"List Git remotes
Usage: jj git remote list
"},{"location":"cli-reference/#jj-git-remote-remove","title":"jj git remote remove
","text":"Remove a Git remote and forget its bookmarks
Usage: jj git remote remove <REMOTE>
"},{"location":"cli-reference/#arguments_30","title":"Arguments:","text":" <REMOTE>
\u2014 The remote's name
"},{"location":"cli-reference/#jj-git-remote-rename","title":"jj git remote rename
","text":"Rename a Git remote
Usage: jj git remote rename <OLD> <NEW>
"},{"location":"cli-reference/#arguments_31","title":"Arguments:","text":" <OLD>
\u2014 The name of an existing remote <NEW>
\u2014 The desired name for old
"},{"location":"cli-reference/#jj-git-remote-set-url","title":"jj git remote set-url
","text":"Set the URL of a Git remote
Usage: jj git remote set-url <REMOTE> <URL>
"},{"location":"cli-reference/#arguments_32","title":"Arguments:","text":""},{"location":"cli-reference/#jj-help","title":"jj help
","text":"Print this message or the help of the given subcommand(s)
Usage: jj help [OPTIONS] [COMMAND]...
"},{"location":"cli-reference/#arguments_33","title":"Arguments:","text":" <COMMAND>
\u2014 Print help for the subcommand(s)
"},{"location":"cli-reference/#options_28","title":"Options:","text":""},{"location":"cli-reference/#jj-init","title":"jj init
","text":"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 [DESTINATION]
"},{"location":"cli-reference/#arguments_34","title":"Arguments:","text":""},{"location":"cli-reference/#jj-interdiff","title":"jj interdiff
","text":"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 evolog -p
instead.
Usage: jj interdiff [OPTIONS] <--from <REVSET>|--to <REVSET>> [FILESETS]...
"},{"location":"cli-reference/#arguments_35","title":"Arguments:","text":" <FILESETS>
\u2014 Restrict the diff to these paths
"},{"location":"cli-reference/#options_29","title":"Options:","text":" -f
, --from <REVSET>
\u2014 Show changes from this revision -t
, --to <REVSET>
\u2014 Show changes to this revision -s
, --summary
\u2014 For each path, show only whether it was modified, added, or deleted --stat
\u2014 Show a histogram of the changes -
--types
\u2014 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
\u2014 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
\u2014 Show a Git-format diff
--color-words
\u2014 Show a word-level diff with changes indicated only by color --tool <TOOL>
\u2014 Generate diff by external command --context <CONTEXT>
\u2014 Number of lines of context to show -w
, --ignore-all-space
\u2014 Ignore whitespace when comparing lines -b
, --ignore-space-change
\u2014 Ignore changes in amount of whitespace when comparing lines
"},{"location":"cli-reference/#jj-log","title":"jj log
","text":"Show revision history
Renders a graphical view of the project's history, ordered with children before parents. By default, the output only includes mutable revisions, along with some additional revisions for context. Use jj log -r ::
to see all revisions. See [jj help -k revsets
] for information about the syntax.
Spans of revisions that are not included in the graph per --revisions
are rendered as a synthetic node labeled \"(elided revisions)\".
The working-copy commit is indicated by a @
symbol in the graph. Immutable revisions have a \u25c6
symbol. Other commits have a \u25cb
symbol. All of these symbols can be customized.
Usage: jj log [OPTIONS] [FILESETS]...
"},{"location":"cli-reference/#arguments_36","title":"Arguments:","text":" <FILESETS>
\u2014 Show revisions modifying the given paths
"},{"location":"cli-reference/#options_30","title":"Options:","text":" -
-r
, --revisions <REVSETS>
\u2014 Which revisions to show
If no paths nor revisions are specified, this defaults to the revsets.log
setting.
-
-n
, --limit <LIMIT>
\u2014 Limit number of revisions to show
Applied after revisions are filtered and reordered topologically, but before being reversed.
-
--reversed
\u2014 Show revisions in the opposite order (older revisions first)
--no-graph
\u2014 Don't show the graph, show a flat list of revisions -
-T
, --template <TEMPLATE>
\u2014 Render each revision using the given template
Run jj log -T
to list the built-in templates.
You can also specify arbitrary [template expressions] using the built-in keywords.
If not specified, this defaults to the templates.log
setting.
template expression: https://jj-vcs.github.io/jj/latest/templates/ built-in keywords: https://jj-vcs.github.io/jj/latest/templates/#commit-keywords
-
-p
, --patch
\u2014 Show patch
-s
, --summary
\u2014 For each path, show only whether it was modified, added, or deleted --stat
\u2014 Show a histogram of the changes -
--types
\u2014 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
\u2014 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
\u2014 Show a Git-format diff
--color-words
\u2014 Show a word-level diff with changes indicated only by color --tool <TOOL>
\u2014 Generate diff by external command --context <CONTEXT>
\u2014 Number of lines of context to show --ignore-all-space
\u2014 Ignore whitespace when comparing lines --ignore-space-change
\u2014 Ignore changes in amount of whitespace when comparing lines
"},{"location":"cli-reference/#jj-new","title":"jj new
","text":"Create a new, empty change and (by default) edit it in the working copy
By default, jj
will edit the new change, making the working copy represent the new commit. This can be avoided with --no-edit
.
Note that you can create a merge commit by specifying multiple revisions as argument. For example, jj new @ main
will create a new commit with the working copy and the main
bookmark as parents.
Usage: jj new [OPTIONS] [REVSETS]...
"},{"location":"cli-reference/#arguments_37","title":"Arguments:","text":""},{"location":"cli-reference/#options_31","title":"Options:","text":" -m
, --message <MESSAGE>
\u2014 The change description to use --no-edit
\u2014 Do not edit the newly created change -A
, --insert-after <REVSETS>
\u2014 Insert the new change after the given commit(s) -B
, --insert-before <REVSETS>
\u2014 Insert the new change before the given commit(s)
"},{"location":"cli-reference/#jj-next","title":"jj next
","text":"Move the working-copy commit to the child revision
The command creates a new empty working copy revision that is the child of a descendant offset
revisions ahead of the parent of the current working copy.
For example, when the offset is 1:
D D @\n| |/\nC @ => C\n|/ |\nB B\n
If --edit
is passed, the working copy revision is changed to the child of the current working copy revision.
D D\n| |\nC C\n| |\nB => @\n| |\n@ A\n
Usage: jj next [OPTIONS] [OFFSET]
"},{"location":"cli-reference/#arguments_38","title":"Arguments:","text":""},{"location":"cli-reference/#options_32","title":"Options:","text":" -
-e
, --edit
\u2014 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
)
Takes precedence over config in ui.movement.edit
; i.e. will negate ui.movement.edit = false
-
-n
, --no-edit
\u2014 The inverse of --edit
Takes precedence over config in ui.movement.edit
; i.e. will negate ui.movement.edit = true
-
--conflict
\u2014 Jump to the next conflicted descendant
"},{"location":"cli-reference/#jj-operation","title":"jj operation
","text":"Commands for working with the operation log
See the operation log documentation for more information.
Usage: jj operation <COMMAND>
"},{"location":"cli-reference/#subcommands_6","title":"Subcommands:","text":" abandon
\u2014 Abandon operation history diff
\u2014 Compare changes to the repository between two operations log
\u2014 Show the operation log restore
\u2014 Create a new operation that restores the repo to an earlier state show
\u2014 Show changes to the repository in an operation undo
\u2014 Create a new operation that undoes an earlier operation
"},{"location":"cli-reference/#jj-operation-abandon","title":"jj operation abandon
","text":"Abandon operation history
To discard old operation history, use jj op abandon ..<operation ID>
. It will abandon the specified operation and all its ancestors. The descendants will be reparented onto the root operation.
To discard recent operations, use jj op restore <operation ID>
followed by jj op abandon <operation ID>..@-
.
The abandoned operations, commits, and other unreachable objects can later be garbage collected by using jj util gc
command.
Usage: jj operation abandon <OPERATION>
"},{"location":"cli-reference/#arguments_39","title":"Arguments:","text":" <OPERATION>
\u2014 The operation or operation range to abandon
"},{"location":"cli-reference/#jj-operation-diff","title":"jj operation diff
","text":"Compare changes to the repository between two operations
Usage: jj operation diff [OPTIONS]
"},{"location":"cli-reference/#options_33","title":"Options:","text":" --operation <OPERATION>
\u2014 Show repository changes in this operation, compared to its parent -f
, --from <FROM>
\u2014 Show repository changes from this operation -t
, --to <TO>
\u2014 Show repository changes to this operation --no-graph
\u2014 Don't show the graph, show a flat list of modified changes -
-p
, --patch
\u2014 Show patch of modifications to changes
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
\u2014 For each path, show only whether it was modified, added, or deleted
--stat
\u2014 Show a histogram of the changes -
--types
\u2014 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
\u2014 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
\u2014 Show a Git-format diff
--color-words
\u2014 Show a word-level diff with changes indicated only by color --tool <TOOL>
\u2014 Generate diff by external command --context <CONTEXT>
\u2014 Number of lines of context to show --ignore-all-space
\u2014 Ignore whitespace when comparing lines --ignore-space-change
\u2014 Ignore changes in amount of whitespace when comparing lines
"},{"location":"cli-reference/#jj-operation-log","title":"jj operation log
","text":"Show the operation log
Like other commands, jj op log
snapshots the current working-copy changes and reconciles divergent operations. Use --at-op=@ --ignore-working-copy
to inspect the current state without mutation.
Usage: jj operation log [OPTIONS]
"},{"location":"cli-reference/#options_34","title":"Options:","text":" -
-n
, --limit <LIMIT>
\u2014 Limit number of operations to show
Applied after operations are reordered topologically, but before being reversed.
-
--reversed
\u2014 Show operations in the opposite order (older operations first)
--no-graph
\u2014 Don't show the graph, show a flat list of operations -
-T
, --template <TEMPLATE>
\u2014 Render each operation using the given template
You can specify arbitrary [template expressions] using the built-in keywords.
-
--op-diff
\u2014 Show changes to the repository at each operation
-
-p
, --patch
\u2014 Show patch of modifications to changes (implies --op-diff)
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
\u2014 For each path, show only whether it was modified, added, or deleted
--stat
\u2014 Show a histogram of the changes -
--types
\u2014 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
\u2014 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
\u2014 Show a Git-format diff
--color-words
\u2014 Show a word-level diff with changes indicated only by color --tool <TOOL>
\u2014 Generate diff by external command --context <CONTEXT>
\u2014 Number of lines of context to show --ignore-all-space
\u2014 Ignore whitespace when comparing lines --ignore-space-change
\u2014 Ignore changes in amount of whitespace when comparing lines
"},{"location":"cli-reference/#jj-operation-restore","title":"jj operation restore
","text":"Create a new operation that restores the repo to an earlier state
This restores the repo to the state at the specified operation, effectively undoing all later operations. It does so by creating a new operation.
Usage: jj operation restore [OPTIONS] <OPERATION>
"},{"location":"cli-reference/#arguments_40","title":"Arguments:","text":" -
<OPERATION>
\u2014 The operation to restore to
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.
"},{"location":"cli-reference/#options_35","title":"Options:","text":" -
--what <WHAT>
\u2014 What portions of the local state to restore (can be repeated)
This option is EXPERIMENTAL.
Default values: repo
, remote-tracking
Possible values:
repo
: The jj repo state and local bookmarks remote-tracking
: The remote-tracking bookmarks. Do not restore these if you'd like to push after the undo
"},{"location":"cli-reference/#jj-operation-show","title":"jj operation show
","text":"Show changes to the repository in an operation
Usage: jj operation show [OPTIONS] [OPERATION]
"},{"location":"cli-reference/#arguments_41","title":"Arguments:","text":""},{"location":"cli-reference/#options_36","title":"Options:","text":" --no-graph
\u2014 Don't show the graph, show a flat list of modified changes -
-p
, --patch
\u2014 Show patch of modifications to changes
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
\u2014 For each path, show only whether it was modified, added, or deleted
--stat
\u2014 Show a histogram of the changes -
--types
\u2014 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
\u2014 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
\u2014 Show a Git-format diff
--color-words
\u2014 Show a word-level diff with changes indicated only by color --tool <TOOL>
\u2014 Generate diff by external command --context <CONTEXT>
\u2014 Number of lines of context to show --ignore-all-space
\u2014 Ignore whitespace when comparing lines --ignore-space-change
\u2014 Ignore changes in amount of whitespace when comparing lines
"},{"location":"cli-reference/#jj-operation-undo","title":"jj operation undo
","text":"Create a new operation that undoes an earlier operation
This undoes an individual operation by applying the inverse of the operation.
Usage: jj operation undo [OPTIONS] [OPERATION]
"},{"location":"cli-reference/#arguments_42","title":"Arguments:","text":""},{"location":"cli-reference/#options_37","title":"Options:","text":" -
--what <WHAT>
\u2014 What portions of the local state to restore (can be repeated)
This option is EXPERIMENTAL.
Default values: repo
, remote-tracking
Possible values:
repo
: The jj repo state and local bookmarks remote-tracking
: The remote-tracking bookmarks. Do not restore these if you'd like to push after the undo
"},{"location":"cli-reference/#jj-parallelize","title":"jj parallelize
","text":"Parallelize revisions by making them siblings
Running jj parallelize 1::2
will transform the history like this:
3\n| 3\n2 / \\\n| -> 1 2\n1 \\ /\n| 0\n0\n