Pangram verdict · v3.3
We believe that this entire text is human-written.
AI likelihood · overall
HumanArticle text · 1,578 words · 1 segments analyzed
This guide is a brief(ish) introduction to the Jujutsu (jj) version control system (VCS) for someone familiar with Git. Why try Jujutsu? jj provides primitives for version control that are simple to learn, but elegantly compose into powerful workflows. Features like automatic rebase and native undo soften the sharp edges of Git. Eventually, you’ll organically discover new powerful workflows that would be too cumbersome to attempt with most other VCS tools. If you work in a Git repository, you can try it today. Jujutsu and Git can be used side-by-side in the same repository, so you can try out jj on a git repo on your own, without fully ejecting from git. Personally, I think jj considerably boosts my effectiveness, because it allows me to keep VCS bookkeeping out of my working memory. Automatic rebasing also makes stacked diff workflows quite easy, and reduces thrashing of my working memory. It’s also just a fun tool to use. Installing jj Official installation instructions are here, but here are a few common methods: # macOS brew install jj # Arch Linux pacman -S jujutsu # NixOS (ideally from nixpkgs-unstable) nix-shell -p jujutsu # From source # (Requires a recent Rust and ~/.cargo/bin on your PATH) cargo install --locked --bin jj jj-cli Setup and configuration In an existing git repository, run: jj git init From here on, jj and git repo state will be synchronized automatically. To set your user details globally, run commands like these: jj config set --user user.name "Some One" jj config set --user user.email "[email protected]" You can edit jj’s TOML configuration for your user in an editor with: jj config edit --user In addition to the --user scope, jj config also has --repo and --workspace scopes. View the merged config with: jj config list Commits and changes A commit, also called a revision, is essentially the same thing as a git commit. It represents a snapshot of repository state that descends from one or more parent repository snapshots. It is often visualized as a diff against a singular parent commit, or in the case of a merge commit, the diff against multiple parent commits once merged. When using a Git repo backend, the jj commit ID is the same as the git commit ID: a hash formatted as a hex string. In the output of jj log below, the hex hashes 2bea5e3d and 849165bc on the right are commit IDs. $ jj log @ kpqxywon [email protected] 2026-11-15 12:17:12 849165bc │ (empty) (no description set) ◆ royxmykx [email protected] 2026-11-15 12:10:46 main 2bea5e3d │ Adjust config ~ The IDs on the left hand side (royxmykx and kpqxywon) are change IDs, which are stable identifiers for logical changes as they physically evolve over time. We’ll discuss these more in the next section. Commit IDs and change IDs can be referenced in shorthand with an unambiguous (unique) prefix. jj helpfully highlights the shortest unique prefix of most IDs to make it easy to type them manually. For example, instead of copying and pasting kpqxywon, we can type in a prefix, down to the shortest unique prefix k. We can inspect the commit 2bea5e3d with jj show, using its short prefix 2. $ jj show 2 Commit ID: 2bea5e3d1992a60ba9ee52c6ce37c55adba9e8fb Change ID: royxmykxtrkrqppotnrvutxlvrvqyxmy Bookmarks: main main@git main@origin Author : Ethan Lowman <[email protected]> (2026-11-15 12:10:46) Committer: Ethan Lowman <[email protected]> (2026-11-15 12:10:46) Adjust config diff --git a/config.py b/config.py index 7366a4e31d..174ffea06b 100644 --- a/config.py +++ b/config.py @@ -1,1 +1,1 @@ -DEFAULT_LIMIT = 10 +DEFAULT_LIMIT = 20 Many folks configure a custom diff formatter, like Delta. See configuration docs if you’re interested. Creating & evolving changes Let’s take another look at our commit graph: $ jj log @ kpqxywon [email protected] 2026-11-15 12:17:12 849165bc │ (empty) (no description set) ◆ royxmykx [email protected] 2026-11-15 12:10:46 main 2bea5e3d │ Adjust config ~ On commit 849165bc, you’ll see the symbol @ on the graph node. This represents a snapshot of our working copy, or the code we have actually checked out in our local directory. We can inspect this special commit pointer in a variety of ways: jj show shows commit details and a diff, which is empty here. $ jj show Commit ID: 849165bca19639dbd6ccb53e8c1340e78c36d59a Change ID: kpqxywonksrltlrkyqukqqsxpltznztk Author : Ethan Lowman <[email protected]> (2026-11-15 12:17:12) Committer: Ethan Lowman <[email protected]> (2026-11-15 12:17:12) (no description set) jj status shows repo state with diff stats. $ jj status The working copy has no changes. Working copy (@) : kpqxywon 849165bc (empty) (no description set) Parent commit (@-): royxmykx 2bea5e3d main | Adjust config jj diff works much like git diff. Its output is empty here, since there are no changes in the current working copy relative to the parent commit. $ jj diff This output isn’t very interesting, since @ has no changes. Let’s make an example change to see what happens. If we edit main.py and rerun jj show, we see this: $ jj show Commit ID: 66b59f20c534705cfb753c722222290e9185b22c Change ID: kpqxywonksrltlrkyqukqqsxpltznztk Author : Ethan Lowman <[email protected]> (2026-11-15 12:26:43) Committer: Ethan Lowman <[email protected]> (2026-11-15 12:26:43) (no description set) diff --git a/main.py b/main.py new file mode 100644 index 0000000000..c74cd2e0e0 --- /dev/null +++ b/main.py @@ -0,0 +1,2 @@ def my_new_feature(): +def my_new_feature(): + pass $ jj log @ kpqxywon [email protected] 2026-11-15 12:26:43 66b59f20 │ (no description set) ◆ royxmykx [email protected] 2026-11-15 12:10:46 main 2bea5e3d │ Adjust config ~ You’ll notice several things have changed. The working copy has been automatically committed, and @ is no longer marked (empty). The new commit ID for @ is 66b59f20, since we’ve added changes, but the change ID for 66b59f20 is still kpqxywon. jj has no staging area like in git, so we don’t have to manually add files. When we run a jj command to inspect or modify repo state after editing files, jj automatically snapshots the working copy as a new physical commit for the relevant logical change. Let’s give this change a description (also called a commit message). We can either run jj desc, which opens an editor, or provide it directly with -m. $ jj desc -m "Implement the feature" Working copy (@) now at: kpqxywon 6b89ffb2 Implement the feature Parent commit (@-) : royxmykx 2bea5e3d main | Adjust config Notice again that the commit ID has changed, since the hash covers the commit message, but the change ID has remained stable. Now, let’s say we’re ready to use this new feature, and we want to organize that change in a separate commit. We can create a new commit with jj new: $ jj new Working copy (@) now at: nlrtlrxv 6cca2add (empty) (no description set) Parent commit (@-) : kpqxywon 6b89ffb2 Implement the feature $ jj log @ nlrtlrxv [email protected] 2026-11-15 12:35:49 6cca2add │ (empty) (no description set) ○ kpqxywon [email protected] 2026-11-15 12:33:23 6b89ffb2 │ Implement the feature ◆ royxmykx [email protected] 2026-11-15 12:10:46 main 2bea5e3d │ Adjust config ~ We’ve created an empty change nlrtlrxv on top of kpqxywon. jj status reflects that we are editing this new revision which does not yet differ from its parent. $ jj status The working copy has no changes. Working copy (@) : nlrtlrxv 6cca2add (empty) (no description set) Parent commit (@-): kpqxywon 6b89ffb2 Implement the feature jj commit is a shorthand for this common jj desc and jj new combo. Let’s make another change to use our new feature, and commit it. $ jj commit -m "Use the feature" Working copy (@) now at: qmkrwlvp 91067ad0 (empty) (no description set) Parent commit (@-) : nlrtlrxv e1b06678 Use the feature $ jj log @ qmkrwlvp [email protected] 2026-11-15 12:41:30 91067ad0 │ (empty) (no description set) ○ nlrtlrxv [email protected] 2026-11-15 12:41:30 e1b06678 │ Use the feature ○ kpqxywon [email protected] 2026-11-15 12:33:23 6b89ffb2 │ Implement the feature ◆ royxmykx [email protected] 2026-11-15 12:10:46 main 2bea5e3d │ Adjust config ~ To inspect the commit we just created (n), we can no longer use the bare jj show, which defaults to showing @. We have to pass the revision we want to inspect: $ jj show n Commit ID: e1b066782aa1a565c1e5d38ef27a308aa58e7e4c Change ID: nlrtlrxvuuskxprvtuznquqzqzzwvnzk Author : Ethan Lowman <[email protected]> (2026-11-15 12:41:30) Committer: Ethan Lowman <[email protected]> (2026-11-15 12:41:30) Use the feature diff --git a/main.py b/main.py index c74cd2e0e0..0714ec450b 100644 --- a/main.py +++ b/main.py @@ -1,2 +1,4 @@ def my_new_feature(): def my_new_feature(): pass + +do_something(my_new_feature()) We can describe empty commits to record intent before starting work. Let’s create a new commit on top of k to remind ourselves that we need to document the feature. $ jj new k -m "Document the feature" Working copy (@) now at: qwyusntz 46a2ffda (empty) Document the feature Parent commit (@-) : kpqxywon 6b89ffb2 Implement the feature Added 0 files, modified 1 files, removed 0 files A separate jj desc would also work just fine instead of the -m flag on jj new. Here’s the current commit graph: $ jj log @ qwyusntz [email protected] 2026-11-15 12:46:35 46a2ffda │ (empty) Document the feature │ ○ nlrtlrxv [email protected] 2026-11-15 12:41:30 e1b06678 ├─┘ Use the feature ○ kpqxywon [email protected] 2026-11-15 12:33:23 6b89ffb2 │ Implement the feature ◆ royxmykx [email protected] 2026-11-15 12:10:46 main 2bea5e3d │ Adjust config ~ Note how we’ve created branching commits without creating a named branch. This highlights a major difference between jj’s branchless model and git’s branch-centric model of organizing work streams. Instead of juggling your work-in-progress on branches, you work on a graph of commits. Once ready to share, you push branches to a Git forge from your commit graph (more on that later). Revsets A revset, an idea borrowed from Mercurial, is an expression that selects a set of revisions