Introduction to the jj Version Control System
Introduction to Jujutsu
Meet Jujutsu
Jujutsu, often called jj, is a modern take on version control. It was designed to address some of the common frustrations developers have with systems like Git. The goal is to provide a user interface that is both simpler and more powerful.
One of the most important things to understand is that jj is not a replacement for Git. Instead, it works with Git. When you use Jujutsu, your project is still stored in a standard Git repository. You can think of jj as a new set of commands, a new lens through which to view and interact with your project's history. This means you can use jj on your existing Git projects without any complicated migration, and your teammates can continue using Git as they normally would.
Always Committed
A major difference between Git and Jujutsu is how they handle your current, unsaved work. In Git, your uncommitted changes exist in what's called the "working copy." This state can feel temporary; if you're not careful, it's easy to lose changes before you've staged and committed them.
Jujutsu changes this with the concept of an automatic "working-copy commit." It treats your current directory of files as a special commit that is always present and automatically updated whenever you save a file. There's no need to manually stage files with a command like git add. Your work is always part of the project's history in a safe, though temporary, state.
Think of it like an auto-saving document. You don't have to constantly press "save" to protect your progress.
jjdoes it for you.
When you're ready to make your changes permanent, you don't create a new commit from scratch. Instead, you describe the changes you've just made. This moves your work from the special working-copy commit into a new, regular commit.
# In Git, you stage and then commit
git add file.txt
git commit -m "A new commit"
# In Jujutsu, you just describe the changes
# Your work is already in the working-copy commit
jj describe -m "A new commit"
History is Flexible
Another core principle of Jujutsu is that your commit history should be easy to change. In Git, rewriting history with tools like rebase can be complex and sometimes risky, especially for beginners. Many developers avoid it entirely.
Jujutsu builds history rewriting into its fundamental design, making it a safe and routine operation. The system includes a comprehensive undo feature, so if you make a mistake while editing a commit message, splitting a commit, or reordering your work, you can always go back. There is no separate reflog to learn; undo is a first-class citizen.
This encourages you to make small, frequent commits without worrying about making the history perfect on the first try. You can always clean it up later, just before sharing your work with others.
| Feature | Git | Jujutsu (jj) |
|---|---|---|
| Backend | Git's native storage | Git's native storage |
| Working Copy | Untracked state; requires git add | Automatic "working-copy commit" |
| History Rewriting | Complex (e.g., rebase -i) | Simple, built-in commands with undo |
| Collaboration | Standard push/pull/fetch | Can sync directly with Git remotes |
This focus on simplicity and safety for powerful operations is what sets Jujutsu apart. It keeps the robust foundation of Git while rethinking the commands you use to interact with it.