October 18th, 2024

Steve Klabnik's Tutorial on Jujutsu (Git replacement)

Steve's Jujutsu Tutorial is a beginner-friendly guide on the Jujutsu version control system, covering installation, commands, workflows, and advanced topics, while encouraging community engagement and feedback.

Read original articleLink Icon
Steve Klabnik's Tutorial on Jujutsu (Git replacement)

Steve's Jujutsu Tutorial is a comprehensive guide aimed at teaching the Jujutsu version control system. The tutorial is structured to help beginners understand the system through a series of sections that cover installation, basic commands, workflows, branching, merging, and conflict resolution. Steve shares his personal journey of learning Jujutsu, expressing his enthusiasm for version control and the challenges he faced while trying to grasp the concepts. He emphasizes the importance of documenting the learning process, both for himself and for others who might benefit from his insights. The tutorial includes practical examples and workflows, such as the Squash and Edit workflows, and delves into more advanced topics like stacked pull requests and workspaces. Steve encourages readers to engage with the content by providing feedback and contributing to the tutorial's development. Overall, the tutorial serves as a resource for those interested in mastering Jujutsu, reflecting Steve's excitement and commitment to sharing knowledge.

- The tutorial is designed for beginners to learn the Jujutsu version control system.

- It covers installation, basic commands, workflows, and advanced topics.

- Steve shares his personal learning experience and encourages reader engagement.

- The content is open for contributions and feedback from the community.

- The tutorial aims to clarify complex concepts in version control for users.

Link Icon 21 comments
By @videlov - 4 months
Martin (the jj creator) recently gave a talk at the Git Merge 2024 conference: https://youtu.be/LV0JzI8IcCY?si=Pun7WJp4ZWvHq-3G
By @klauserc - 4 months
Been using jj at work for months now. In colocated mode, JetBrains IDEs even retain some if their VCS integration.

The ability to easily work on top of an octopus merge and then push changes "down" into the contributing branches has been a live saver when my team had to do a big refactoring in a mono repo and split the changes into small PRs for individual teams (code owners).

The auto committing behavior is a bit weird at first, but now I don't want to go back to git. It feels a bit like the step from SVN to git back in the the day. ("this feels weird" -> "how did people ever tolerate the old way?")

By @swiftcoder - 4 months
> I also heard friends rave about "stacked diffs" but struggled to understand what exactly was going on there. Nothing I read or conversations I had have clicked.

I wonder what it is about descriptions of stacked diffs that doesn't land - it's literally just a rebase-centric workflow instead of the merge-centric workflow popularised by GitHub et al.

By @phildenhoff - 4 months
Steve, I see you’re in this thread. I was using jj for a while before reading your tutorial and yet still found it quite insightful and helpful. Thanks for your contribution!
By @jFriedensreich - 4 months
I am torn between sapling and jj. Both make good progress in git/github integration which seems to have been the major road block in adoption before. One other major roadblock seems to be the limits of review tools supporting stacks: github PRs are too limited, gerrits ux is horrible, graphite does not work and is not open enough, saplings review tool is just a very slow performing POC (though with a really good UI concept as starting point)
By @nixosbestos - 4 months
One of my favorite people talking about my single favorite tool of the past 3+ years. Up there with (above, really) zellij and helix for changing my daily life.
By @thih9 - 4 months
Love it, read a couple of chapters already and planning to finish the rest. As a person completely new to jj and someone who also enjoys git CLI, this is an intuitive, very useful and enjoyable read.

I’m especially interested after learning about the git compatible backend:

> There's one other reason you should be interested in giving jj a try: it has a git compatible backend, and so you can use jj on your own, without anyone else you're working with to convert too.

By @lawn - 4 months
I really like Jujutsu but I went back to Git because there wasn't a Neovim plugin with features comparable to Neogit or Fugitive.

I even started writing one but that was a pretty big project and I lost the motivation for it.

By @stavros - 4 months
This was informative, thanks Steve! The only problem I had was that the difference between changes and commits wasn't clarified enough in the beginning, and I got lost trying to distinguish between the two. I'm on chapter 4 and I'm still not sure what a change is and what a commit is.

From a tiny bit of previous jj experience, my mental model is "a commit is the snapshot, and a change is what happened between snapshots", but that might be wrong. It would be great if this could be clarified a bit more in the tutorial.

By @aos - 4 months
I’ve started to use jj much more often (and actually used this tutorial to get me started!). I do wish its interaction with Nix flakes is less annoying though, but that’s not the fault jj.
By @chaostheory - 4 months
I get that naming is one of the hardest problems in computer science, but naming software after a martial art is just lazy and will lead to problems with things like searches
By @ZoomZoomZoom - 4 months
Would be great if it was Pijul that got Steve's attention. Sometimes it's all you need to achieve a lot.
By @nextaccountic - 4 months
Can someone sometimes use jj and sometimes use git in the same repo?
By @drudru - 4 months
Steve wrote this in a very approachable style. It is the first time I really understood what 'jj' is about. I'm actually kind of excited to start using this tool with my git repos.
By @forrestthewoods - 4 months
I’d love a Sapling vs JJ comparison post. I use Sapling at the day job and… it’s pretty dang good! Although I don’t see how I’d recommend it outside of Meta.

I swear the modern programmer doesn’t realize how extremely bad Git is. It does do a lot of things better than SVN. But it’s a long, long ways from “good” imho.

I blame GitHub. Git didn’t win because it’s good. Git won because GitHub won. If only HgHub had won instead, alas.

My dream VCS system would have a virtual file system, copy-on-write storage, and a system wide blob cache. The goal being to allow open source repos to commit *ALL* their dependencies, up to and including toolchains in many cases.

By @leighleighleigh - 4 months
It's my first time encountering your writing Steve, loved it! Time to give JJ another crack...
By @cyanf - 4 months
thank you steve, i’ve been excited for this!
By @itohihiyt - 4 months
Came here for a martial arts tutorial, which I thought was a bit weird to see front page on HN, and now I see an alternative to git.

I don't particularly like git and for personal projects use fossil instead.

Without going through the whole tutorial, and doing a lot more reading, why should I consider using this over fossil?

By @red_admiral - 4 months
I expected actual Jujutsu :)

I recommend looking up Bartitsu (that Conan Doyle spelled Baritsu), a short-lived but very interesting martial art.

By @38 - 4 months
Jujutsu is terrible in my opinion. people hate the index, but I think they just dont get it. to me a commit is something that is ready to push, and the index is for stuff that is done but not ready to push. just because I wrote one line that I am happy with, doesn't mean I am ready to commit and push that. I prefer to add stuff thats done, then when enough is done I can commit and push. if you remove the index it makes it too easy to push half done stuff