Jujutsu (jj) - Git-Compatible Version Control Cheatsheet
Jujutsu (jj) is a modern version control system that is Git-compatible — it uses a Git repository as its backend, so you can adopt it on existing repos and interoperate with teammates using Git. Its model is different and, for many, simpler: the working copy is itself a commit (no separate staging area), conflicts are first-class objects you can commit and resolve later, and every operation is recorded in an operation log you can undo. There are no branches in the Git sense by default; you work with changes identified by stable change IDs.
Installation
| Platform | Command |
|---|
| Cargo | cargo install --locked jj-cli |
| macOS (Homebrew) | brew install jj |
| Arch Linux | sudo pacman -S jujutsu |
| Nix | nix profile install nixpkgs#jujutsu |
| Windows (Scoop) | scoop install jujutsu |
| Verify | jj --version |
Setup
| Command | Description |
|---|
jj config set --user user.name "Your Name" | Set your name |
jj config set --user user.email "you@example.com" | Set your email |
jj git init --colocate | Init jj in an existing Git repo (keeps .git) |
jj git clone <url> | Clone a Git repo with jj |
jj git init | Create a new jj repo (native backend) |
Core Concepts
| Term | Meaning |
|---|
| Change | A logical change with a stable change ID (survives rewrites) |
| Commit | A snapshot; the working copy is always a commit (@) |
@ | The current working-copy commit |
| Revset | A query language for selecting commits |
| Operation log | History of repo operations, each undoable |
| Bookmark | A named pointer (maps to a Git branch on push) |
Everyday Workflow
| Command | Description |
|---|
jj status | Show working-copy changes |
jj log | Show the commit graph |
jj diff | Diff the working-copy commit |
jj describe -m "msg" | Set/replace the current commit’s message |
jj new | Start a new change on top of the current one |
jj new <rev> | Start a new change on top of a specific commit |
jj edit <rev> | Make an existing commit the working copy |
jj commit -m "msg" | Describe @ and start a new change (Git-like) |
Moving & Editing History
| Command | Description |
|---|
jj squash | Move changes from @ into its parent |
jj squash -i | Interactively choose what to squash |
jj split | Split the current commit into two |
jj rebase -d <dest> | Rebase a change onto a destination |
jj abandon <rev> | Drop a commit |
jj duplicate <rev> | Copy a commit elsewhere |
The Killer Feature: Undo
| Command | Description |
|---|
jj op log | List every operation performed |
jj undo | Undo the last operation |
jj op restore <id> | Restore the repo to a previous operation state |
Because every command is an operation, almost anything can be undone — including rebases and abandons.
Bookmarks & Git Interop
| Command | Description |
|---|
jj bookmark create main -r @ | Create a bookmark (≈ Git branch) |
jj bookmark set main -r @ | Move a bookmark to a commit |
jj git fetch | Fetch from the Git remote |
jj git push | Push bookmarks to the Git remote |
jj git push -c @ | Create a remote branch from the current change |
Revsets (Selecting Commits)
| Revset | Selects |
|---|
@ | Working-copy commit |
@- | Parent of the working copy |
main | The commit a bookmark points to |
mine() | Your commits |
ancestors(@) | All ancestors of @ |
jj log -r "description(glob:'fix*')" | Commits whose message matches |
Common Workflows
# Adopt jj in an existing Git repo, keep working with Git remotes
jj git init --colocate
jj log
# Make a change without staging — just edit files, then describe
# (files are auto-snapshotted into @)
jj describe -m "Add feature"
jj new # start the next change
# Oops — undo the last thing you did (even a rebase)
jj undo
# Push the current change as a branch for review
jj bookmark create feature -r @
jj git push -c @
jj vs Git
| Aspect | Jujutsu (jj) | Git |
|---|
| Staging area | None (working copy is a commit) | Index/staging |
| Conflicts | First-class, committable | Must resolve before proceeding |
| Undo | Universal via op log | Reflog (partial) |
| Branches | Bookmarks (optional) | Branches (central) |
| Backend | Git-compatible | Git |
Resources