Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Shopping list

Here's my formula to learn Jujutsu:

  1. Clear the slate, stop having Git as your mental model.
  2. Embrace a few new assumptions. They'll seem repugnant at first. Try to suspend judgment. They'll pay off.
  3. Learn the few basic building blocks. It's super easy, it's no more than 5 commands.
  4. Profit.

After this, you will:

  1. Be astounded by the new workflows you never thought were possible. Learn them, invent new ones.

I trust you with step 1. Let's go with 2. I'm going to tell you about a few traits of Jujutsu that will make you cringe.

Git Was An Adorable Maverick

Being an old programmer and coming from CVS and Subversion, I clearly remember when Git was presented. It really sparked a chorus of angry protests:

  • "Keeping a local copy of whole history! This is so stupid!"
  • "Branches are not real branches!"
  • "Rewriting the history! Heresy! To the stake!"
  • "No central server! The world will collapse into anarchy!"

Looking back, it was a fun show. I just never expected a sequel.

Jujutsu Is Being a Maverick Like Git

Better to hear all the bad news now so we can move on. Let's pull this tooth:

  • Jujutsu pushes are forced by default.
  • It commits by itself, at every possible occasion.
  • Even jj status commits.
  • Rebases happen automatically.
  • By default, Git ignores files. Jujutsu tracks them.
  • Commits are mutable.
  • Working in detached HEAD is the standard.
  • With Git, first you code, then you commit. With Jujutsu it's idiomatic to commit before coding.
  • jj won't update Git branches as you commit.
  • It deletes commits without any warning.

At times it feels like Jujutsu was designed to deliberately upset Git fans (it's not like this, of course, but it's still a funny show). In the same vein, Jujutsu is defined more by what it removes than by what it adds:

  • It's branchless.
  • There's no index.
  • Stash does not exist.
  • There's no merge command.
  • No cherry-pick, no reset, no add.

Given this iconoclastic baseline, you'll be dismayed knowing that people use Jujutsu:

  • working in the middle of a branch, not at its tip.
  • Sending commits to the past.
  • Developing on multiple features, then dispatching the changes around.
  • Working simultaneously on multiple branches.

Horrified? Wait until you realize you love every bit of it.

Still with me? Good: you are already at step 3. Let's learn the building blocks and finally profit.