Shopping list
Here's my formula to learn Jujutsu:
- Clear the slate, stop having Git as your mental model.
- Embrace a few new assumptions. They'll seem repugnant at first. Try to suspend judgment. They'll pay off.
- Learn the few basic building blocks. It's super easy, it's no more than 5 commands.
- Profit.
After this, you will:
- 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 statuscommits. - 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.
jjwon'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
mergecommand. - No
cherry-pick, noreset, noadd.
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.