How to start using Jujutsu (jj) with an existing Git repository

You will install Jujutsu on top of an existing Git repository, make commits without a staging area, and undo mistakes with the operation log. It suits developers who already know basic Git commands and want automatic snapshots. You need Git 2.42.0 or newer, jj installed, and a terminal.

YouTube video: Jujutsu (jj) GitHub Overview: Working-Copy Commits, Change IDs, and Undo

Caption availability is unknown. Check the CC control in the YouTube player.

10 chapters. Tap a step to jump to it.Chapters from the creator
Choose a chapter (10)
Video length
5 min 54 s
Time to do it
15 minutes
Difficulty
Medium
Steps
8

What you need

Steps

  1. Install Git 2.42.0 or newer first, then install jj from the official releases page, cargo, Homebrew or your system package manager. Check both with git --version and jj --version.

  2. Set your identity so commits carry the right author. Run jj config set --user user.name "Your Name" and jj config set --user user.email "[email protected]".

  3. Turn your existing Git repository into a colocated workspace by running jj git init --colocate inside it. The.git folder stays in place, so Git commands keep working.

  4. Run jj status to see the working copy itself as a commit. There is no staging step: edits to tracked files are snapshotted automatically as you work.

  5. Run jj commit -m "your message" to finish the current change and start a fresh empty working-copy commit on top of it.

  6. Run jj log to view the repository graph. Each commit shows a stable change ID next to the usual commit hash.

  7. Run jj op log to list past operations, then jj undo to roll the repository back to the previous state if something went wrong.

  8. Edit an earlier commit and jj rebases the commits built on top of it for you. Conflicts are recorded inside the commit instead of blocking your next command.

Tips and common mistakes

Because every edit is snapshotted, use jj new to start a separate change instead of leaving unrelated work in one commit.

Change IDs stay the same when a commit is rewritten, so use them in commands rather than short hashes that change.

Jj undo only reverses operations jj recorded, so changes made with plain Git commands are not rolled back by it.

Back up or push important branches before you start rewriting history in a colocated repository.

Questions

Do I have to stop using Git?

No. A colocated workspace keeps the.git directory in sync, so you can keep running git status, git log and git push alongside jj.

What is a change ID?

It is a stable label jj gives each commit. Unlike a commit hash, it survives rewrites such as rebasing or amending, so it is safer to reference.

Where did the staging area go?

Jj has no index. The working copy is treated as a mutable commit, so file edits are captured automatically without git add.

The notes are drafted automatically from video details and general task knowledge. How the guide was prepared

Report a correction

More in Apps & Software

See all