Skip to content

Jujutsu

Jujutsu is a Git-compatible version control system (VCS) written in Rust that aims to provide a more streamlined and user-friendly experience than Git. It introduces concepts that simplify common developer workflows and make version control more intuitive.

Key Concepts

One of the core primitives in Jujutsu is the “change,” which is analogous to a Git commit but with a key difference: changes are mutable. This means you can freely modify a change after it has been created. Each change has an immutable, randomly generated ID that remains constant even as the content of the change is modified. In contrast to Git’s detached HEAD state, it is perfectly normal in Jujutsu to have changes that are not associated with a branch.

Another significant feature is the jj undo command, which allows you to undo any operation, providing a safety net that is particularly helpful for those learning the system.

Furthermore, in Jujutsu, any modifications you make to your files are automatically part of the current change, known as the “working copy.” This eliminates the need for a separate staging area or Git index, as any file modifications are always within the scope of a change. You can create a new working change with jj new and add a description with jj describe.

Streamlined Workflows

Jujutsu simplifies many common Git workflows. For instance, instead of git stash, you can simply create a new change based on the parent of your current working copy (jj new @-), leaving your work-in-progress as a regular change that you can return to later with jj edit.

Amending a commit that is several commits deep in your history is also straightforward. With jj edit <change-id>, you can check out and modify any mutable change. Any subsequent changes will be automatically rebased on top of your modifications. This seamless, automatic rebasing is a significant advantage over the manual multi-step process required in Git.

This ease of rewriting history is particularly beneficial for managing stacked pull requests. If a change in the middle of a stack needs to be amended, you can simply edit it, and all dependent changes will be automatically updated. Pushing the updated branches is then a single command.

Conflict Resolution

Jujutsu treats conflicts as a first-class citizen. Unlike Git, where a conflict blocks most other operations until it is resolved, Jujutsu allows a change to exist in a “conflicted” state. You can switch away from a conflicted change, create new changes on top of it, and continue your work without being forced to resolve the conflict immediately. When you are ready, you can resolve the conflict by either editing the files directly or using a three-way merge tool.

Getting Started with Jujutsu

You can start using Jujutsu with an existing Git repository by running jj git init --colocate. This command sets up Jujutsu to work alongside your existing .git directory, allowing it to keep your Git data updated. This seamless integration means you can try out Jujutsu without disrupting the workflow of your collaborators who may still be using Git.

References

Page last modified: 2025-07-24 12:30:51