I've been using JJ almost exclusively for over 2 years now. It's great, it works fantastically with our rather large monorepo at work.
However I mostly use it backing on to a custom VCS, not git. I can't wait to see some JJ-native forges that don't try to keep it compatible with git, I think there's a lot more benefits and more UX to be explored there!
I doubt so, because not being compatible with the git repo format (and therefore requiring distinct hosting, therefore socially excluding from GitHub) is what slowly drove mercurial into obscurity, even though its UX was (and still is) superior to that of git (and JJ, which drew from it), not to mention the other aspects which made hg a much sounder choice on technical merits (e.g. very large monorepos), the users and decision makers both couldn't stand breaking away from the git repo format.
I agree that this was a factor in Mercurial dying, but I'm not sure this holds today. Mercurial performed significantly worse than git, that was a factor at the time, but in 2026 the perception is that git doesn't perform well enough (see GitHub outages, GitLab writing on this topic, Anthropic developing their own VCS, etc). Even small teams I know (circa 10 committers) are finding Git to not scale to the speed they're working at now.
JJ has the potential to be a substantial step forward in performance. This will depend on the backend to fully realise it, but a backend that prioritises scalability could vastly outperform git and GitHub's storage.
I think in the post-Microsoft acquisition, post-Dear GitHub letter era, GitHub's shine has worn off. I see a lot more use of GitLab for open source, a lot more use of various other forges. I don't think it's a requirement for a thriving open source project in the way it was for ~2010-2020.
This is somewhat on purpose. For most people GitHub is most of their git experience. But even if it's not, GitHub represents the most mature attempt to scale git storage, and at this point it seems to be clear that it's not doing well at that, at this point it's likely that's not a git problem, but a GitHub problem. The fact that other large companies have migrated off git due to scalability issues is further evidence for that. Git's data model is just not designed for the scale of software engineering happening now.
My point isn't that trivial git is slow, that's perfectly fast enough. My point is that when you've got a big repo, a bunch of committers, need multiple serving machines/replicas, consistency, etc, git is slow.
GitHub is the best implementation of that which I have seen, and GitHub even started to get pretty slow on a repo with >100k commits.
Git is breaking, and I don't know if there's any saving it at this point.
You actually could have the same effect as `hg init` with `git init`, but the command I mentioned leaves no working directory so uses less space on the server. Potentially hundreds of megs of disk space are worth a dozen keystrokes, no?
If you absolutely want nothing checked out, `hg update null`. Again "bare repos" are an absolutely unnecessary cognitive burden an UX papercut just like many things git.
You don't have to use bare repos, I just prefer them. You can use `git init` and ignore the working directory, just like you apparently [can] do in hg.
Sure, but that was before the GitHub monopoly, the social/gamification of it, before the monoculture that ensued, and at a time when it was normal to cruise through the day using 2/3 distinct VCSes (being a FOSS contributor before 2010, you probably would use svn/git/hg/bzr on a daily basis and not need to RTFM for most routine commands like branching, checking in, merging and sharing a diff/series in one form or another).
Git felt like it had "inevitable" momentum way before GitHub.
In 2005 my company was using Darcs. We had previously used CVS and then Subversion. Darcs felt like finally the right, modern, decentralized version control system had arrived, even though there was no GitHub for it. Darcs was magical in ways that Git still can't measure up to.
But arround me more and more colleagues were starting to use Git, which they gushed about as being the new cool thing. Git, at that time, was barely more than a very unfriendly set of commands with barely any documentation. But even before GitHub it seemed like "worse is better" was clearly winning over Darcs and the other new contenders.
By circa 2007 we had switched over. The thing that really pushed us over was that Darcs had a huge, work-stopping bug that the authors could not resolve. Darcs 2 eventually made the bug less of a problem, but it was too late, and at that point it was even more niche than in 2005.
GitHub was clearly instrumental in cementing Git's "monopoly" on version control. Once GitHub was out, the writing was on the wall.
I originally thought to write "Git winning might be as simple as linux and github using it.", before I decided to shorten it:) Yes, I think that was a significant factor.
not to mention that many at mozilla cried over the loss of mercurial, with some mozillians part-time mercurial contributors rolling-up their sleeves and putting their weight behind jj as a "lesser evil" kind of compromise.
Totally different situation IMO. Git and GitHub were not incumbents at the time. Mercurial mainly lost because it was overall worse than Git, ignoring network effects.
You cannot decouple "VCS" (the component at the core of the project collaboration fabric) and "network effects". Too bad we don't have time machines: how many chose git over alternatives because "they've seen others doing it", without putting time and effort to weigh the pros and the cons? My observation is: a substantial amount.
I'm not too bothered about the backing store but I really want to see some forges gain support for code review based on jj changes rather than git branches and commits. The Github model absolutely sucks if you're someone who likes to keep a coherent history because if you squash the resolution of PR comments into the parent commits nobody can see what changed between when the comments were made and now.
Basing code review on changes and changesets would mean that the evolution of each change could be seen in isolation, which would also mean that you immediately do away with awkward workarounds like PR stacks.
Have to say staging area is one feature that makes people better programmers. Especially using GUI tooling to pick hunks or discard parts you don’t want to go to a commit was always super useful for me. (CLI of staging hunks is not convenient at all for me)
I keep running into people who “just commit stuff” and they don’t know what they are doing.
Downside is we are heading into direction where people don’t even read code anymore so I might be just old man screaming at the clouds or agents.
> With the staging area, you don’t even know if the commit builds if you commit selectively, and manual adding is error-prone.
I get conceptually why it’s desired to have things build properly on every commit but I just haven’t seen people actually make use of that. In my team’s current code base, we have the commits in a given PR auto-squash down into one commit which I’ve liked quite a bit
First, server-side CI is usually only running for the last commit, so if you have a series of commits pushed at once, this doesn't really help.
Second, it's not even so much about the validating a commit (which, for intermediate steps, it might not do), but so that each commit hangs together and a change as a logical unit doesn't exist partly in one and partly in another commit [1].
Conceptually, the whole staging process flies in the face of the idea that a commit should represent an atomic repo change and feels more CVS-like.
> That's a UI problem. I've been manually selecting code with Magit for years and it's very effective.
There are two counterpoints I would like to make here. One is that if you need additional tooling to work around a problem in an existing tool, that does not mean the original tool does not have a problem.
The other is that better tooling does not mean that the increased error rate from unnecessary manual steps goes away; it can mitigate it, but it does not do away with the consequences of e.g. inadvertent lapses of attention.
And realistically, in most cases it is just unnecessary extra work for no good reason.
[1] Mind you, there's the problem that commits are really used for two different things, one is to capture conceptual steps and one is to to do quick save of the repo state, and no existing VCS does a good job of reconciling these two different purposes.
> Second, it's not even so much about the validating a commit (which, for intermediate steps, it might not do), but so that each commit hangs together and a change as a logical unit doesn't exist partly in one and partly in another commit [1].
That's what review is for.
> Conceptually, the whole staging process flies in the face of the idea that a commit should represent an atomic repo change
No it doesn't. The staging area is precisely what allows you to carefully build a commit. Before git, we had to do the same by backing up the modified files somewhere else and creating a commit, then bringing them back. I used to use CVS, then Subversion, then a mix of Darcs and Arch, before git finally solved it.
> One is that if you need additional tooling to work around a problem in an existing tool
You're assuming there's a problem. There isn't.
> Mind you, there's the problem that commits are really used for two different things, one is to capture conceptual steps and one is to to do quick save of the repo state
Using commits to save state is bad and I've forbidden it in my team. Jujutsu makes it more convenient so that uncommitted state is itself a special commit that gets pushed to the server, but the real solution is what Google's SrcFS does: workstations checkout code on top of a FUSE filesystems that really gets saved on the server side, so state can never get lost on a single machine.
That’s something I have the same thoughts on, because long time ago I used CVS/SVN and staging area with stashing was exactly the answer for what you wrote.
Combined with stashing you can quickly build to see if the commit builds.
Git supports all of it and people and jj are just complicating it by “let’s skip all of that and make a commit” because they don’t see it actually is simpler.
I just see how in 5 years someone who would be used only to jj will come over and re-invent staging and stashing “because I want changes but I don’t want to make a commit”.
Think of it this way: you still have a staging area in jj, but now it's a commit instead of something unique and separate. There's zero obstacle to picking and discarding hunks with jj.
> Think of it this way: you still have a staging area in jj, but now it's a commit instead of something unique and separate.
Indeed. One nice thing about this is you can have a staging area for the staging area (repeat ad nauseum). It's not that unusual that I treat a commit as the staging area, and then I want to do something experimental on top of it, and make a new commit on top of my staging area and try things out there - ultimately to squash into my main staging commit.
In my last job I gave a presentation on jj and I hammered this point. I said it's like git but with everything version controlled. The index/staging is version controlled. The stash is version controlled. Technically even things like setting/unsetting bookmarks, commit descriptions etc are version controlled.
Yes, for new that's what `jj split -i` / `jj commit -i` do by default. For existing that's `jj squash -i`.
`-i` makes it interactive (you select the changes you want in the parent, using a TUI), but you can also pass the list of files as arguments. You can also choose which commit you want to split (for split) or move from, to (for squash), etc, with arguments. More info on them here: https://docs.jj-vcs.dev/latest/cli-reference/#jj-split
Yep. `jj split` says "take this change and put parts of it into a new change". `jj squash` says "take this change and put parts (or all) of it into an existing change".
Someone already said this, but you just use jj split. Either split the whole file or use interactive mode to split the exact lines. You could also use squash if you want to move it to an existing revision/commit.
Jj makes it vastly more efficient and ergonomic to perform surgery across commits - no staging area to think about, remember, stumble over, etc. Conflicts don't stop the world.
It's all dead simple if you use jjui - don't even need to learn any jj syntax
The stuff you wrote is always captured in a commit and never in some weird lingering (uncommitted) state.
Treat the HEAD commit like your staging area. Split it as you will, pick stuff you like, remove stuff you don't want and push it to a different commit, etc. Feel free to rewrite history as you will (that you haven't exposed publicly, for others to depend on).
In jj you create a new commit for the staged parts, you can name it "wip: foobariating", and then the gui tooling allows you to move files between both commits, for me it's the equivalent of a staging area/stash that you can name
At first the auto-staging (or whatever it's called) is annoying. It sure is if one is used to dump random files in the repository, that haven't been ignored.
After some time, I realised it gives a lot of freedom. Working on something but not in a workspace, and need to do something else for the day? Just jump somewhere else. Everything will still be there when you get back.
In other words, it's hard to lose things by mistake. In those situations it's also cool to describe (name) the work being done, prior to making a normal commit.
A bit odd but one can also push `@` to a remote (e.g. iterating on something and piggy backing on a CI-system), avoiding having to squash and then push.
Having a stack of PR's, then rebasing it all to see a conflict, and only having to deal with it one is also magical.
Moving bookmarks around can be annoying.
Workspaces work fine, and there's two options:
- the normal ones, where a full .git isn't created. That works fine, unless having tooling that expects the workspace to also work as a git repository, in which case ..
- you can make the workspace collocated, less lightweight, but git tooling works
Jumping around has been the biggest thing to me. If I wanted to look at another branch real quick, I would've either done a worktree, another clone of the repo, or some bullshit commit like 'WIP' or something.
As others have said, the head commit is effectively a staging area, it just contains everything that you've done which you can then split/squash/rebase as you see fit. `jj split -i` felt like magic the first time I used it.
Automatic bookmark naming is 100% cursed, I always name them, and also don't subscribe to this weird one commit per-bookmark/PR thing people seem to have adopted. You can use bookmarks just like git branches in practice.
Rebasing is so much nicer than doing the same thing with git because its going to do its best to finish the job, then leave you with a coherent set of conflicts you can clean up one commit at a time. Its still conflict resolution, and it still sucks, but at least you feel less like you're fighting the tooling.
Finally, workspaces exist and work reasonably well. Annoyingly Claude Code specifically has real trouble interacting with them, and last I tried in agent mode refused to accept that a jj workspace is just as valid a mechanism as a git workspace. They may have fixed that by now, its been a while since I tried.
Then imagine having as many staging areas as you want, stacked or in parallel branches or arbitrary combinations thereof with easy mechanisms to move chunks between them. That's Jujutsu.
Git feels like running with leaden shoes by contrast.
At the start of the day, I resumed working on a feature; there's no staging, so modifications I make are all stored as the current change.
Later that day I realised I needed to actually save the version of the feature that existed when I started work that morning.
So into the evolog I go (`jj evolog`). It's a record of all commits that a change has been; I could scroll back through the recorded changes, find the first change made that day, and then 'jj new' to create a change that represents that work.
It felt magical, to just be able to jump back to a project state that I didn't explicitly record, then save it.
As a sibling said it tracks snapshots that are taken every time you run a jj command. A pattern I follow is to keep a window open and ‘watch -n 1 jj log’ so that I can see the graph update in real-ish time when I’m navigating or shuffling commits. It also has the benefit of snapshotting any changes once per second. If nothing changed, no snapshot happens. It’s a nice backstop against forgetting to commit some earlier change that was later wiped out.
The jj log graph is very nice visually in the terminal.
Other people mentioned it, but since it was what I did; I didn't commit the day before/that morning. I didn't realise I'd need that morning's version, I only realised that after mutating it.
So it's the "oh no, I realise now that I needed to commit before I made all those changes" situation, but since the workspace gets snapshot/committed on every jj command, nothing was lost.
The evolog doesn’t track explicit commits. It is a list of snapshots of the codebase. JJ creates a new snapshot every time you run a command (or edit a file, depending on how you configure it).
One of the nice things about jj is you don't need to name a branch. You're just working on a graph. When you think you have something consistent and would like to give a name to it, you can do it (before or after the fact). But the lack of friction in creating a temporary new branch is amazing.
If you used VCS before git and loved how easy branching is in git, this is the same feeling in jj, but now with git being the old, tedious way.
> One of the nice things about jj is you don't need to name a branch.
Maybe it's due to different thinking process. But I can't think of doing a branch without knowing why I would need to do it, which also give me a quick indication of how I should name it. Everything is local anyway so I don't complicate stuff.
You see the description of changes in your log, and so that's often good enough as a name. No need to give it a second one. Here's an example from a project of mine:
It's nicer with color. Anyway, this is an anonymous branch, with two changes on it. "add running compiler image identity" and "harden running image identity fixtures" let me know what that branch is about, without needing to add an extra name onto the branch itself.
I want tooling centered around the concept of a patch, not the concept of commits.
Commits for me are settled patches. I don't go around editing commits that much (and I have the tooling to make it trivial). Because for me, the patch inside has served it purpose. When I found a new purpose for it, the context has already been changed, so even when it saved me a bit of typing, I had to look at it anew.
So only the few commits around my current tasks are in flux. There's not a lot, so rebasing is very easy, even with the git cli. Same with editing a span of commits. It becomes the workspace and thus can easily be modified. Everything else is just on hold. That's why I like named branch. Because I look at it holistically instead of individual commits.
Maybe your workflow is different, and you are always doing surgical treatment to a complicated tree. But I never needed to do so. These days I'm even leaning towards a single patch for a feature or a fix. Way easier for communication.
I think the single commit case makes it even less of a need to name the branch, since the description is very much naming exactly what piece of work it is already.
> I really don't like the automatic bookmark naming thing.
That's only when you're pushing, and you can always explicitly name it. I've never done an automatic bookmark.
> I'm also skeptical about automatic rebasing
Automatic rebasing is one of the best things about jj. I rely on it so much (just jump back to the commit with the bug and fix it right there) that I don't think I'd be happy with any version control system that doesn't have it.
I recently created a project which utilizes FUSE to serve git files directly from object store without a checkout. Main motivation was to sepeedup a worktrees creation (I work on a huge monorepo). In my case it helps a lot - now I wait a second instead of a minute.
But then I realised there are other interesting features which having vfs opened:
- tree structure of related branches (simplest case of that are stacked PRs) which rebases itself
- live preview of merge state or any node of such tree
- on demand creation of a new branch which merges any of the existing ones very cheaply (e.g for a throwaway build check)
- quick and simple comand which shows conflicting files between selected worktree and all others
- agents gets notified about such conflicts when they happen
I was able to design it in a way so git sees those virtual workspaces as normal worktrees, and all git commands works exactly as you would expect. So I think for some people, especially on the very big repositpries, it might solve a few problems they try to solve with jj.
FUSE isn't new, but GitFS, EdenFS and VFS for Git solve a different problem: lazy fetching from a server. A checkout is cheap until something reads it - e.g agent trying to run rg over the whole tree. That problem is solved in gitfold.
Also gitfold does not need or try to change any existing git behavior, and is fully compatible with existing git binaries without any modifications.
So while used technology is the same, approach is from completely different angle.
Ha, fair: ClearCase dynamic views were a filesystem too. The difference is that nothing is remote and git stays the source of truth. And it's a single binary that runs without root, tiny next to a behemoth like ClearCase.
I'm fully onboard with the idea that git is horrible to learn and unfriendly for beginners, and also that jj is more convenient and a better UX. I do however struggle to find the point of it for me personally when I've suffered with git for long enough that it has become deeply familiar and very intuitive, and these days I mostly interact with it at a distance through a robot. I've yet to see anything which is for me personally compelling enough to make the effort to switch.
You are welcome to do whatever you like! But I do think that you're being unreasonable when you are deliberately using a less convenient tool, seemingly just for the sake of it.
jj just makes everything so much easier. But more than that, it has capabilities that are not available in git - eg how it deals with conflicts. There's tons of guides and essays out there about all of this so I won't try to enumerate all the differences
There would surely be some uncomfortable learning period, but it is worthwhile. jjui makes it that much easier too.
> these days I mostly interact with it at a distance through a robot.
Bad ergonomics-- terrible languages, clunky linters, complicated VCS-- can be offloaded to the clanker but the cost is still there. A clanker fighting to un-foobar a git repo is a clanker that spending tokens and coherence on not-the-thing-you-wanted.
One of the best ways I have seen to "clear the head" of a robot is to provide better tooling that requires less cognitive burden-- for the user, or in markdown skills, its all the same.
Another way to say it is that JJ keeps the context small, for both the user and a clanker. The mental model is simpler, it's just a DAG of changes. Unlike git there's nothing else tacked on, no extra staging area or stash to keep track of.
> Perhaps the value becomes clear on larger teams, big monorepos?
I find it incredibly useful as an individual contributor opening many PRs on a single upstream project. I can rebase all my PRs onto new upstream changes in one go, I can easily keep the commit graph neat, I can easily squash changes down into specific PRs while keeping my working tree positioned after they all merge together. Really speeds up my workflow, it's awesome. And it's really cool that merge conflicts don't block operations. It's really limiting that git has only one active branch at a time.
Interesting! Thanks for the explainer, speed / concurrent development makes sense; that's one area I probably subconsciously steer away from due to the awkwardness.
>> I find it incredibly useful as an individual contributor opening many PRs on a single upstream project
> I probably subconsciously steer away from due to the awkwardness.
I think if I need to rebase a PR enough while waiting for merge that it's a coordination issue and maybe too much churn in the codebase. There shouldn't be a need to do so. Not sure I'd blame git for that.
I have to be the one to rebase my PR or my signature will become invalid. The only valid way to merge my commits is via fast-forward.
(Do let me know if this has changed, but I've seen any other kind of merge result in the yellow "Unverified" status on GitHub, as I have the thing turned on that requires all commits from me to be signed with my own key.)
That's just the surface concern. Why is the review time so large that you have multiple PRs ongoing? Why is the codebase churning you have conflicting changes that aren't trivial?
No one is obligated to review PRs in a timely manner, nor stop development for me in particular. The entire point of a PR is that I put in all the work to maintain it as long as it is open, and eventually someone may get around to reviewing and potentially merging it. Upstreaming is a volunteer process.
The single most compelling reason is probably `jj undo` and `jj redo`, with having a generally more consistent user interface and design being not far behind.
The rest is probably a bit more of a tradeoff for many people in that jj like git also has a non-traditional mental model that you have to learn, with the difference that there is actually rhyme and reason behind jj's. But whether learning that (which can be a non-trivial effort) is worth it to you if you're already accustomed to git idiosyncrasies is a personal decision.
git has some rhyme and reason, but to me it's like the imperative to jj's declarative. jj feels like a React of version control, performing all the needed mutations automatically to arrive at the result you've specified, while git is still concerned about each individual mutation one at a time. There are layers you can add on top of git to achieve jj-like capability, and I often see people asking how jj has any benefit over such a layer.
i really don't understand jj. what is the point of deleting the useful stage and treating the worktree as the project, which contains your debug harness, compiler artefacts, build files, and other things that you generally don't want in your project. you have to either write a .gitignore counterpart for jj or manually remove them before committing.
just treat your stage as the real project and worktree as some ephemeral sandbox. as you work build your index in stages by `git add -e` and removing your debug harness hunks. as soon as you reach a milestone, just commit and type your message when the context is fresh in your head.
with jj, you work all day and finally when you are ready to commit, you now have to manually remove your debug harness, remove build artefacts, and reverse engineer your own code to write a commit message when you just want to go home.
stop treating the stage as a implementation detail poking out into userspace. if it was just a implementation detail, linus wouldn't have defended it so fiercely.
I agree with you but I think that's more of a problem of the tutorials / docs out there than of the tool, which feel like they sell not reviewing your changes before committing as a selling point (that I disagree with). It seems like you just want what's usually called the "squash workflow"[0]. You create a new change on top `jj new`, when you want to "stage" changes, you can use move them to the parent commit by using `jj squash -i` to choose them interactively, or `jj squash path/to/file1 path/to/file2` to choose which files you want to move (similar to `git add`).
In practice I usually just use `jj commit -i`, where you just select the files you want to keep there, edit / add the description (commit message) and a new change is created on top for your new working area.
> compiler artefacts, build files
I agree with my sibling those should be .gitignored and if not, yes those those may cause problems with `jj`
> debug harness
I think that works pretty well with `jj` actually. Let's say mid work you're interrupted and needs to check a an commit. `abc` is your current working copy and `def` is the commit you want to checkout. You can leave your harness behind (`jj new def`), do whatever you need there, then come back (`jj edit abc`). You can also bring your harness with you with `jj rebase -s @ -o def`. If it's something you commonly use, you can create a change for it and keep it as a parent, and then use a filter to prevent changes starting with a prefix (let's say local:) from being pushed. That said, there are some rough edges about keeping changes as a parent IMO (like having to set up command aliases or keep having to move it, depending on your workflow).
if you are mid work and suddenly need to checkout something you checkout in a new worktree so that all your context remains intact. `git worktree` has been in stable since 2015.
i have not used jj, but if you are introducing sqaush/new just you get what the stage does cleanly then you are implictly agreeing with the stage model.
JJ also has worktrees (called workspaces), but some repositories require more setup (like .env, install dirs, etc), and just checking out ends up being simpler and faster.
> i have not used jj, but if you are introducing sqaush/new just you get what the stage does cleanly then you are implictly agreeing with the stage model.
Squash / new also do it cleanly, just like `git add -e` (I'm not sure what you mean with "cleanly", does it mean "as a special concept?"). And you're right, I agree with the stage model (that's most of the point of my comment!), and I personally think it works pretty well on jj.
> you are introducing sqaush/new just you get what the stage does cleanly
I think that's where I disagree with you. Git introduces the staging area (and stash) as separate concepts divorced from the DAG of changes. JJ just has the DAG, and nothing else. I'd say JJ is the cleaner model.
> Let's say mid work you're interrupted and needs to check a an commit. `abc` is your current working copy and `def` is the commit you want to checkout. You can leave your harness behind (`jj new def`), do whatever you need there, then come back (`jj edit abc`). You can also bring your harness with you with `jj rebase -s @ -o def`.
It was not complicated with git either. If there was some important change that I didn't want to commit yet, I stash it. Same with experiments that contained valuable information. Then I can use stash apply whenever I want. Never had trouble jumping around the git graph.
One key thing is that I find that conflicts are a very good signal for when the intent of the worktree at commit c clashes with the intent of patch p. Especially if you've designed the code to follow the single responsibility principle. I don't want to sweep this under the rug. Instead I want to solve it right away.
A lot of jj advocates need to better highlight their workflows and why they think git was not doing well for them. I think there's too much focus on managing files instead of unit of changes (contained in patches).
Same as the index, the stash is also just a commit. It's not that it's impossible to do any of this in git, it's that it's more orthogonal in jj. Commits, the stash, and the index are three features in git, but a single feature in jj. This also means you can bring all of the tools to use on your psudeo-index and psuedo-stash that you use to work with commits.
commits: clean patches that have been integrated somehow (even as a draft version in my local repo)
index: patch in progress (very short lived as I usually add things and commit right after). It's an editing space.
stash: valuable patches in terms of knowledge, but not relevant to any current task
While they look similar, they have different purposes and so interact with different tools.
I code for one purpose (and maybe get distracted for one thing or two) then goes on to clean up the patches and write a proper message. It's not a matter of adding and rejecting hunks. I also do edit them normally. Tooling is not a problem as I spend more time on reading and editing than on tool calls.
Stashing is similar. The patches stored there are individuals, meaning I don't have to worry about dependency when I delete one. I also don't have to worry about location as there's just one stash concept.
You can also find a way to do the same operation in jj, but I want tooling centered around the concept of a patch, not the concept of commits. jj make it awkward to work with patches.
> A lot of jj advocates need to better highlight their workflows and why they think git was not doing well for them.
Yes, I agree. Nowadays I use jj but I had the same feel before trying it, and I do think git usually works fine. What does it for me is just that it makes things simpler and there are fewer commands and special cases. I can use the same command I use to stage things and to move some changes from/to any commit (`jj squash -i`, adding `--from` and `--into` as needed). The same command I use to create a new commit is the one I use to merge (`jj new`, a merge is just a commit with more than one parent). It's super easy to change which commit a branch points to (`jj bookmark move`). With a few commands I can do most things and most of the time I just look at the single page CLI reference[0] to figure it out in a few minutes. I still use git when I need one of the (still) unsupported features, which in my case were submodules and LFS.
> If there was some important change that I didn't want to commit yet, I stash it. Same with experiments that contained valuable information. Then I can use stash apply whenever I want. Never had trouble jumping around the git graph.
Stash: for me, I just find it simpler with jj really. My "stash entries" show up in `jj log` just like everything else, and I immediately know in which parent it's based on. I can use the same commands to deal with the stash as I use for every commit, like I said in the previous paragraph, and I do not need to remember at which index the change was on the stash stack. I can also add a description to it if I want. Surely it's possible to do most of these in git, but in jj I already know how to do all of these as it's the same as any other commit.
> One key thing is that I find that conflicts are a very good signal for when [...] I don't want to sweep this under the rug. Instead I want to solve it right away.
Edit: ah, you're talking about the article. I also don't like leaving conflicts open and I do not use the edit workflow (where you edit commits in history directly). I will either: 1. create a new commit on top of the one I want to edit, then squash and immediately fix conflicts, or 2. work on the latest and squash all the way to the commit I want it on, then fix conflicts. TBF I don't think the way the article does it is too different from what you'd do with git, on git conflicts would only show when you do something like a rebase, a merge, maybe an amend. With the edit workflow it shows up when editing the files. At that point on git you're also "ignoring" the conflicts as you haven't merged / rebased yet.
For me the advantage on `jj`'s conflict handling is that I'll create a new commit on top of the conflicted commit, fix the conflicts there, then review while squashing my fixes (or maybe even comparing to the conflicted commit's parent, with `jj diff --from @--`, this way I can see the whole picture of the fix.
I set it to `snapshot.auto-track = "none()"` in the global config so that it is turned off by default and then selectively adjust it for a project.
You can also leave it as `none()` and then manually add files as before.
Note also that this has nothing to do with the staging area, but with selecting which files to add to a repo, which other VCSes can do just fine without having a staging area.
In fact, selective auto-track plus not having to explicitly stage changes makes it less of a risk that you forget to add something.
i think forgetting to add something to stage is no worse than adding your debug to master/main because auto track added it. again, i appeal that please be deliberate about what you are adding. after all software engineering is a craft, so craft you commits.
jj makes it easier to craft good commits than git does. This is specifically because the index is just another commit. You cannot apply your slice and dice tools to the index in git, but you can with jj, since the index is a commit like any other.
> i think forgetting to add something to stage is no worse than adding your debug to master/main because auto track added it.
I agree with that, which is why I pointed you at the auto-track setting. I also think that automatically adding everything is a poor default.
> after all software engineering is a craft, so craft you commits.
I could not disagree more. Reliability dictates that you minimize the risk of errors, including those from having unnecessary manual steps for frequently repeated operations.
My point here is especially git vs. pretty much any other VCS aside from jj, not git vs. jj; do not assume there are only two options here. Being explicit about adding files to a repo is generally a good idea. Having to repeat the process for already added files for every commit is just another opportunity for errors.
And as I wrote in another comment [1], I actually consider the staging area an anti-pattern for unrelated reasons.
Stage or no, git or jj, not writing a gitignore once and never worrying about removing hunks as you described or filtering the list of unstaged files in your brain for debug artifacts seems like completely unnecessary cognitive load. I’ve never come across a project that staunchly refuses to gitignore the paths of build artifacts that shouldn’t be checked in. It’s basic hygiene to prevent accidents. I really can’t understand any reason to oppose doing so.
it only causes accident if you do git add --all. and my exact thesis is to be deliberate about what you commit.
`git add -e` your files as you are satisfied (of course after remove your debug harness). this way you debug harness stays put in your sandbox/worktree and no harness leaks into your project which remains pristine. this is something that .gitignore cannot do. jj cannot. you have remove all your harness, TODOs and others just to commit and then add it back again. that just means your version control failed.
and no, i am not advocating you should no add .gitignore.
> you have remove all your harness, TODOs and others just to commit and then add it back again
No, you don't. You can split. You can untrack. You can change your auto-track configuration. There are many ways to deal with this other than having to remove them. You can be equally deliberate about what goes into your final commit.
> i really don't understand jj. what is the point of deleting the useful stage
You have a much more flexible stage in jj than in git. It's not gone anywhere. They just promoted it to first class and don't call it a stage.
> you have to either write a .gitignore counterpart for jj or manually remove them before committing.
I'll admit it is a pain. The one nice outcome, though, is that you now have everything in .gitignore and don't get "?" in your status.
> just commit and type your message when the context is fresh in your head.
The nice thing about jj is you don't need to worry about the "fresh in your head" part. You can write the commit message before you even begin, and modify it as you go along. You can commit things with no message (which I sort of use as staging), and much later, after several commits, go back and put in the message.
Fewer steps on average. When you don't need to be selective you don't need to do "git add", for example. Most of my commits when I used git were that way. Forcing me to do a git add each time added friction.
jj gives you the best of both worlds. If you want the friction, you can have it - with no more commands than with git. If you don't want it, fewer commands. And if you want a fancier stage you can have that too.
What I miss is a guide on how a good commit history should look like, ideally focused on real-world examples.
There's lot's of jujutsu tutorials that teach you how to undo operations and write commit messages before the commit, but almost none cover what to do with all this power.
It's easy to name some general principles like “it should be easy to read” but I don't think it helps, especially if you're a novice like me.
I think you're probably overthinking things. Split your changeset into a series of commits each of which encapsulates one step along the way to achieving the overall goal of your changeset.
As an example, you might end up with "Refactor to facilitate adding feature X", "Data models for X", "API endpoints for X", "UI for X". Each of those would contain all the code/tests/documentation for each of those steps.
The nice thing about jj is that it makes it really easy to have a bunch of messy commits locally as your bouncing around the place, followed by squashing/splitting things as appropriate. In practice that first refactor commit might only come into existence very late after you've built a bunch of endpoints and done some refactoring along the way.
The guide I usually point people at is https://mainmatter.com/blog/2021/05/26/keeping-a-clean-git-h... . It talks about git and the Fork GUI, which I find to be great for visualising what is going on in the repository, particularly for beginners who don't have a strong mental model of the commit graph.
Jujutsu tries to be nonprescriptibe about the end result, but my understanding of the megamerge strategy is that you want the powerful rebasing to help you manipulate many branches in parallel (fixes, features, etc), test them together, and end up with a linear history once accepted each is accepted.
This isn't a real world example though.
In practice I end up producing a branch where the commits are the kind of "ideal"; units of work that build on each other, but not interspersed with "fix something we didn't in notice in the commit a week ago".
Codex seems to do pretty well with jj in my experience. I often use it to do things like resolving the conflicts in a rebased stack. The two main issues I found were having to remind it to use jj instead of git in a colocated repository, and it getting stuck when some commands open the interactive hunk selector or an editor.
I wrote a jj skill (https://github.com/mhw/jj-skill) that tries to address both of those issues, and explaining some higher-level workflows like the conflict resolution example I described above. It happily goes through the conflicts creating new commits off them, resolving the conflict, and then squashing the results.
The LLMs I use seem to handle it (I'm not sure about the token efficiency though). It could actually be more token efficient because I'm not rebasing as often.
Long-term I'm sure LLMs will have JJ in their training data.
GLM-5.3 does seem to speak jj quite fluently and without consulting docs. Including complex codebase restructure and recovery of corrupted object storage.
I think all the models do pretty well with jj now. I just added instructions and a skill to make sure they always use jj rather than git commands.
Only gap that I care about is jj workspaces<->git worktrees is not fully implemented. You can now auto create a worktree when you create a workspace, but not the reverse. There's prs for this though. I hope they get merged soon.
Jj with jjui is such a nice way to work. I can have a bunch of agents going in different workspaces and easily rebase work using a visual tool. A small skill to help AI work with workspaces over worktrees is all I needed to smooth the seams.
Someone here on HackerNews once advised me to just wing it and start using it. So, I started jj (Jujutsu) in small doses across my personal projects. I’m still at a super early stage, and my muscle memory is still stuck in Git.
Totally guilty to have used AI (Claude Code) entirely to make this learning tool for me, and hopefully for others. There may be errors, please feel free to correct and point out.
jj - taken through a small repository through 24 steps, drawn in 3D. Beside each step is the same step in Git.
how does using something like this compare to just using a simple git-wrapper that does all the hard stuff for you (ala lazygit)?
Is jujutsu worth learning a whole new workflow for?
In my experience, git has a few workflows that work well, and you can wrap them to improve the UX. JJ on the other hand is just designed better – there are many more workflows that will work well in it, and you can mix and match them more effectively, and because it's better designed there's less need for wrappers to simplify the UX because the fundamentals are simpler.
That said, I think JJ will get better when it's backing on to something that's designed from scratch rather than backing on to git and forges like Git(Hub|Lab) which really restrict it.
I used jujutsu regularly for a while (several months) about a year ago. My conclusion, in short, was that the improvement over my lazygit based setup was small enough that it wasn't worth the friction and small annoyances of jj. I'd still recommend trying it if you have the bandwidth for it, it just isn't a strong recommend of "this is undoubtedly better".
Longer version: if jj was what git had been originally, it would have saved millions of people a lot of pain and annoyance. It's definitely a better tool than git originally was. By now, though, git has gotten reasonably better, and the ecosystem around it has become polished enough, that the nicer, well-thought out UI of jj isn't as much of a slam dunk win anymore. It's still pretty good to work with, but there were enough papercuts for it to be not worth it for me: missing docs and features due to immaturity (presumably/hopefully to a lesser degree by now than back then), the friction of bookmarks interacting with branches in remote git forges, the fact that every throwaway file is committed right away (theoretically optional, practically assumed by every jj workflow out there) so you need to both ignore it and prune it out of history every time, there being `jj <command>`s and `jj git <command>`s that you need to remember which is which - all of these have understandable reasons and are small things, but overall added up to the fact that I felt myself dreading the jj-specific issues more than I enjoyed the upsides of it.
JJ, using the squash workflow, is brilliant for working with Claude
The workflow is straightforward: I create a named revision for the work I want to do, then an unnamed revision on top. I prompt Claude, changes land in the unnamed revision, I review those, squash the parts that I'm ready to accept, prompt some more to iterate on the parts that aren't up to par yet. Rinse and repeat until the topmost (unnamed) revision is empty.
I instructed Claude that I use jj with the squash workflow, so it should never touch revisions with a non-empty description (I also needed to tell it to shut up about that check), and the whole thing flows pretty damn smoothly.
I just tell Claude to fold changes in their respective commits when working on a feature branch. No need to do rebase edits or anything else really. I don't really have to think of what gymnastics it has to do to get there.
I wrote a piece on what specific advantages jj brings over git, and what kind of development workflows deserve it. Give it a read if you are debating internally whether jj deserves a place in your toolbox: https://sarthakag.bearblog.dev/from-git-to-jj-jujutsu/
Recently JJ supports colocated workspace/worktrees so you get a .git directory in the workspace so git is happy. Also workmux has initial support for JJ colocated workspaces and sesh (tmux session handler) also has experimental support. Whilst there are still some sharp edges, none of them are around data integrity, and I'm using it every day. YMMV.
> I found it hard to get Claude and other agents to use it consistently and more effectively than git.
Write yourself a very good JJ skill or reference file from your AGENTS.md.
My LLMs struggled with it a lot too, but I slowly covered everything they were messing up and they haven't made a mistake in months now. Even when there are "divergent" issues, it knows how to recover now.
Yeah it took me a while to get agents comfortable with it. Mostly I had access to Gemini, and 2.x and early 3.x models struggled. By 3.7 it was much better, and with all the 4 models it's a complete non-issue. Separately I (and others) worked on improving our JJ skills and they're in a much better place now with some scripts that wrap up more complex operations (e.g. maintaining file copy/move markers).
This hasn't been an issue for me for a while now, and I've actually had Opus 5.5 and Gemini Hydrogen build and submit a 28 commit deep stack, with all the reviewing/rebasing/shifting around that entails.
During late 3.x timeframe Google has been explicitly adding Jujutsu support across the agent stack in Antigravity, but it's not fully exposed unlike Git yet
That's also true, the Antigravity harness may have been a contributing factor here. I use the internal Antigravity fork which uses JJ heavily because JJ is a core supported VCS interface for us.
That tracks. I've not used JJ in public Antigravity, only in the internal fork, and that's not JJ for git, but JJ for Piper, so I don't know how much commonality there is.
From my understanding it's pretty much one to one as far as understanding of JJ commands goes, but my setup has long lived JJ skills so I don't really know what's built in and what's not...
> I found it hard to get Claude and other agents to use it consistently and more effectively than git.
That was the biggest hurdle for me too. I was a 2+ year jj user, then I had to switch back to git because of all the agentic tools relying on it.
I recently went back to jj, after finding a decent skill [1] and discovering Emacs' majutsu plugin. Claude still tries to do a git command every once in a while, but it's a lot more bearable.
I use jj with open weight models and Claude Opus without much trouble, even without any explicit skill loaded for them - maybe they've made it into the training data? They seem to understand how the two differ conceptually and when told that the repo it is working in uses jj they stop using stash (or at least claim to).
I can say this hasn't always been the case, and until about 2 (maybe 3?) months ago I would handle all the VCS related parts of the work. I would let the agents write code, which I've found less and less necessary to tweak as time has gone on, and write the commit messages and create the PRs by hand.
My colleagues (who use git) let Claude write commit messages, but I find those awfully long-winded and my eyes just glaze over when I open their PRs - but to each their own I guess.
At least the Claude commit messages are an improvement over the commit messages before - I gave up trying to get them to apply the recommendations of how to write good commit messages given in https://cbea.ms/git-commit/
I used to think this even just 6 months ago, but I no longer do. With the right prompting it's possible to get near-human results on commit chains. That said, I'm not suggesting you shouldn't review code, you absolutely should, it's just that I am fine letting agents manage the commits now.
Use hooks. Prompts are for guiding an agent towards a goal. If you want it to never, ever, do a thing then write some hooks that detect an attempt to use git and refuse the tool use. "Is the `git` executable in this command line" is entirely deterministic and doesn't require throwing an LLM running on 15 GPUs at the problem.
I really would like to move my workflow to jujutsu but I have repos that use git-lfs. This has been open for over 4 years at this point: https://github.com/jj-vcs/jj/issues/80
Whatever (the) jj evangelists might say, I have yet to find a single use case (and I do mean a single one) where it has been useful to me. Any workflow they propose can easily be implemented with ordinary scripts. I understand that for "ordinary users" who can't tell Git's index apart from a remote repository, scripting that stuff is a pain. But I can't stop being surprised by the tenacity of people who fully understand that they could have implemented jj as an extension to Git itself, literally like git-jj extensions, yet chose to rewrite it from scratch and market it as a Git replacement. Well, a lot of time and effort has been spent in the wrong direction. But then again is that anything new in software engineering?
jj is great, we use it a lot and we've hijacked it to make a decision-management/context-management system [0]. it's also generally very useful for keeping commit history clean and the squash workflow is good for progressively iterating with ai-written code, since you can squash to preserve the good parts and get agents to build on that.
sadly jj doesn't have critical mass to "just work" like git does with LLMs.
I proposed it and the team rejected saying jj solves a problem that was solved by LLMs and git, and that it would introduce paper cuts to our workflow.
huh? I have no issues with Claude and JJ. Git can do all the same stuff, since it's git under the hood, but using JJ encourages Claude to rewrite the commits. Which is good for us cause review is our bottleneck.
Can you get good diffs in the UI, for every turn, and never run into detached head stuff, assumptions about git etc. Does creating threads have to be told not to make worktrees? Do you have to tell it not to make temporary clones because it wigs out about uncommitted files in the current folder. This is just a small sampling of problems you get with using Claude / Codex with JJ. In general, tooling that assumes git makes design choices based on that which are just a little wrong.
JJ is much better, and I want the tooling to support it better, but it's not there yet in general.
It seems like a good usability upgrade to git but a few years too late. I don't even remember how to use git anymore since the only thing I do manually is pushing to and pulling from the remote repo.
However I mostly use it backing on to a custom VCS, not git. I can't wait to see some JJ-native forges that don't try to keep it compatible with git, I think there's a lot more benefits and more UX to be explored there!
JJ has the potential to be a substantial step forward in performance. This will depend on the backend to fully realise it, but a backend that prioritises scalability could vastly outperform git and GitHub's storage.
I think in the post-Microsoft acquisition, post-Dear GitHub letter era, GitHub's shine has worn off. I see a lot more use of GitLab for open source, a lot more use of various other forges. I don't think it's a requirement for a thriving open source project in the way it was for ~2010-2020.
Try `git init --bare --shared`. You'll never pay for GitHub again.
GitHub is the best implementation of that which I have seen, and GitHub even started to get pretty slow on a repo with >100k commits.
Git is breaking, and I don't know if there's any saving it at this point.
If Mercurial was better than Git it would have won the distributed versioning system war.
I remember Mozilla picking Hg instead of Git to migrate from CVS, and most people were unhappy about it because they prefered git.
People learnt git to use GitHub
In 2005 my company was using Darcs. We had previously used CVS and then Subversion. Darcs felt like finally the right, modern, decentralized version control system had arrived, even though there was no GitHub for it. Darcs was magical in ways that Git still can't measure up to.
But arround me more and more colleagues were starting to use Git, which they gushed about as being the new cool thing. Git, at that time, was barely more than a very unfriendly set of commands with barely any documentation. But even before GitHub it seemed like "worse is better" was clearly winning over Darcs and the other new contenders.
By circa 2007 we had switched over. The thing that really pushed us over was that Darcs had a huge, work-stopping bug that the authors could not resolve. Darcs 2 eventually made the bug less of a problem, but it was too late, and at that point it was even more niche than in 2005.
GitHub was clearly instrumental in cementing Git's "monopoly" on version control. Once GitHub was out, the writing was on the wall.
Which is mostly a critique of how Darcs was badly implemented and trivial equivalent of "git pull" could tank a big server.
From SVN, there was a lot to push towards Git because of speed, too.
But all of those above were also arguments for Mercurial, and that's where GitHub is real divergence point IMHO
At the time there were a couple of low-key Mercurial server solutions: bitbucket, and another I can' quite recall. And then there was Github.
At the time it very much felt like the HN/Silicon Valley hype-cycle/publicity bandwagon jumped on Github. That's really what won 'the war'.
It's a bit like saying, if betamax was better than VHS it would have one the video battles.
Back in the day, Windows was still 'king' and Mercurial was Windows friendly, and git really wasn't, and that still wasn't quite enough.
Ah, so Windows is better than Linux/UNIX and MacOS. Got it.
Basing code review on changes and changesets would mean that the evolution of each change could be seen in isolation, which would also mean that you immediately do away with awkward workarounds like PR stacks.
https://jjhub.dev/
(I am the author)
I really don't like the automatic bookmark naming thing.
I'm also skeptical about automatic rebasing, but having conflicts not block the process could be nice, I'll have to try it out on more complex trees.
Also, I didn't see a section on workspaces, but I assume they basically do the right thing.
I keep running into people who “just commit stuff” and they don’t know what they are doing.
Downside is we are heading into direction where people don’t even read code anymore so I might be just old man screaming at the clouds or agents.
With the staging area, you don't even know if the commit builds if you commit selectively, and manual adding is error-prone.
The traditional "clean" way has been to stash unwanted changes temporarily, then commit the rest.
I get conceptually why it’s desired to have things build properly on every commit but I just haven’t seen people actually make use of that. In my team’s current code base, we have the commits in a given PR auto-squash down into one commit which I’ve liked quite a bit
You should always use server-side CICD.
> and manual adding is error-prone
That's a UI problem. I've been manually selecting code with Magit for years and it's very effective.
First, server-side CI is usually only running for the last commit, so if you have a series of commits pushed at once, this doesn't really help.
Second, it's not even so much about the validating a commit (which, for intermediate steps, it might not do), but so that each commit hangs together and a change as a logical unit doesn't exist partly in one and partly in another commit [1].
Conceptually, the whole staging process flies in the face of the idea that a commit should represent an atomic repo change and feels more CVS-like.
> That's a UI problem. I've been manually selecting code with Magit for years and it's very effective.
There are two counterpoints I would like to make here. One is that if you need additional tooling to work around a problem in an existing tool, that does not mean the original tool does not have a problem.
The other is that better tooling does not mean that the increased error rate from unnecessary manual steps goes away; it can mitigate it, but it does not do away with the consequences of e.g. inadvertent lapses of attention.
And realistically, in most cases it is just unnecessary extra work for no good reason.
[1] Mind you, there's the problem that commits are really used for two different things, one is to capture conceptual steps and one is to to do quick save of the repo state, and no existing VCS does a good job of reconciling these two different purposes.
That's what review is for.
> Conceptually, the whole staging process flies in the face of the idea that a commit should represent an atomic repo change
No it doesn't. The staging area is precisely what allows you to carefully build a commit. Before git, we had to do the same by backing up the modified files somewhere else and creating a commit, then bringing them back. I used to use CVS, then Subversion, then a mix of Darcs and Arch, before git finally solved it.
> One is that if you need additional tooling to work around a problem in an existing tool
You're assuming there's a problem. There isn't.
> Mind you, there's the problem that commits are really used for two different things, one is to capture conceptual steps and one is to to do quick save of the repo state
Using commits to save state is bad and I've forbidden it in my team. Jujutsu makes it more convenient so that uncommitted state is itself a special commit that gets pushed to the server, but the real solution is what Google's SrcFS does: workstations checkout code on top of a FUSE filesystems that really gets saved on the server side, so state can never get lost on a single machine.
Combined with stashing you can quickly build to see if the commit builds.
Git supports all of it and people and jj are just complicating it by “let’s skip all of that and make a commit” because they don’t see it actually is simpler.
I just see how in 5 years someone who would be used only to jj will come over and re-invent staging and stashing “because I want changes but I don’t want to make a commit”.
Indeed. One nice thing about this is you can have a staging area for the staging area (repeat ad nauseum). It's not that unusual that I treat a commit as the staging area, and then I want to do something experimental on top of it, and make a new commit on top of my staging area and try things out there - ultimately to squash into my main staging commit.
In my last job I gave a presentation on jj and I hammered this point. I said it's like git but with everything version controlled. The index/staging is version controlled. The stash is version controlled. Technically even things like setting/unsetting bookmarks, commit descriptions etc are version controlled.
1. I write some code.
2. I realise it makes sense to commit as two commits.
3. I stage changes for the first commit & commit it.
4. I stage the remaining changes and commit those.
How would that work in JJ? I guess you do things in a different order somehow?
`-i` makes it interactive (you select the changes you want in the parent, using a TUI), but you can also pass the list of files as arguments. You can also choose which commit you want to split (for split) or move from, to (for squash), etc, with arguments. More info on them here: https://docs.jj-vcs.dev/latest/cli-reference/#jj-split
Jj makes it vastly more efficient and ergonomic to perform surgery across commits - no staging area to think about, remember, stumble over, etc. Conflicts don't stop the world.
It's all dead simple if you use jjui - don't even need to learn any jj syntax
1. I write some code.
2. I realise it makes sense to commit as two commits.
3. I run `jj split` to split it into two changes.
4. I describe (add messages) to both commits, and push them.
* working tree == in progress
* staging area == finished
How do can I split modifications to a single file into multiple commits? (In git)
Treat the HEAD commit like your staging area. Split it as you will, pick stuff you like, remove stuff you don't want and push it to a different commit, etc. Feel free to rewrite history as you will (that you haven't exposed publicly, for others to depend on).
At first the auto-staging (or whatever it's called) is annoying. It sure is if one is used to dump random files in the repository, that haven't been ignored.
After some time, I realised it gives a lot of freedom. Working on something but not in a workspace, and need to do something else for the day? Just jump somewhere else. Everything will still be there when you get back. In other words, it's hard to lose things by mistake. In those situations it's also cool to describe (name) the work being done, prior to making a normal commit. A bit odd but one can also push `@` to a remote (e.g. iterating on something and piggy backing on a CI-system), avoiding having to squash and then push.
Having a stack of PR's, then rebasing it all to see a conflict, and only having to deal with it one is also magical.
Moving bookmarks around can be annoying.
Workspaces work fine, and there's two options:
- the normal ones, where a full .git isn't created. That works fine, unless having tooling that expects the workspace to also work as a git repository, in which case ..
- you can make the workspace collocated, less lightweight, but git tooling works
JJ lets you freely move through the history.
Automatic bookmark naming is 100% cursed, I always name them, and also don't subscribe to this weird one commit per-bookmark/PR thing people seem to have adopted. You can use bookmarks just like git branches in practice.
Rebasing is so much nicer than doing the same thing with git because its going to do its best to finish the job, then leave you with a coherent set of conflicts you can clean up one commit at a time. Its still conflict resolution, and it still sucks, but at least you feel less like you're fighting the tooling.
Finally, workspaces exist and work reasonably well. Annoyingly Claude Code specifically has real trouble interacting with them, and last I tried in agent mode refused to accept that a jj workspace is just as valid a mechanism as a git workspace. They may have fixed that by now, its been a while since I tried.
Git feels like running with leaden shoes by contrast.
At the start of the day, I resumed working on a feature; there's no staging, so modifications I make are all stored as the current change.
Later that day I realised I needed to actually save the version of the feature that existed when I started work that morning.
So into the evolog I go (`jj evolog`). It's a record of all commits that a change has been; I could scroll back through the recorded changes, find the first change made that day, and then 'jj new' to create a change that represents that work.
It felt magical, to just be able to jump back to a project state that I didn't explicitly record, then save it.
The jj log graph is very nice visually in the terminal.
So it's the "oh no, I realise now that I needed to commit before I made all those changes" situation, but since the workspace gets snapshot/committed on every jj command, nothing was lost.
One of the nice things about jj is you don't need to name a branch. You're just working on a graph. When you think you have something consistent and would like to give a name to it, you can do it (before or after the fact). But the lack of friction in creating a temporary new branch is amazing.
If you used VCS before git and loved how easy branching is in git, this is the same feeling in jj, but now with git being the old, tedious way.
Maybe it's due to different thinking process. But I can't think of doing a branch without knowing why I would need to do it, which also give me a quick indication of how I should name it. Everything is local anyway so I don't complicate stuff.
https://news.ycombinator.com/item?id=50577902
But the relevant bit to this is the following
Commits for me are settled patches. I don't go around editing commits that much (and I have the tooling to make it trivial). Because for me, the patch inside has served it purpose. When I found a new purpose for it, the context has already been changed, so even when it saved me a bit of typing, I had to look at it anew.So only the few commits around my current tasks are in flux. There's not a lot, so rebasing is very easy, even with the git cli. Same with editing a span of commits. It becomes the workspace and thus can easily be modified. Everything else is just on hold. That's why I like named branch. Because I look at it holistically instead of individual commits.
Maybe your workflow is different, and you are always doing surgical treatment to a complicated tree. But I never needed to do so. These days I'm even leaning towards a single patch for a feature or a fix. Way easier for communication.
EDIT
reply slowed down by HN moderation.
I'd be OK if I had to immediately (blocking any operations) choose whether to add or (locally) ignore the file, but auto-add isn't for me.
Or edit the commit if you just want to make a quick fix you know you'll want to squash immediately.
That's only when you're pushing, and you can always explicitly name it. I've never done an automatic bookmark.
> I'm also skeptical about automatic rebasing
Automatic rebasing is one of the best things about jj. I rely on it so much (just jump back to the commit with the bug and fix it right there) that I don't think I'd be happy with any version control system that doesn't have it.
Does jj have something like git rerere?
I recently created a project which utilizes FUSE to serve git files directly from object store without a checkout. Main motivation was to sepeedup a worktrees creation (I work on a huge monorepo). In my case it helps a lot - now I wait a second instead of a minute. But then I realised there are other interesting features which having vfs opened:
- tree structure of related branches (simplest case of that are stacked PRs) which rebases itself
- live preview of merge state or any node of such tree
- on demand creation of a new branch which merges any of the existing ones very cheaply (e.g for a throwaway build check)
- quick and simple comand which shows conflicting files between selected worktree and all others
- agents gets notified about such conflicts when they happen
I was able to design it in a way so git sees those virtual workspaces as normal worktrees, and all git commands works exactly as you would expect. So I think for some people, especially on the very big repositpries, it might solve a few problems they try to solve with jj.
https://github.com/pkukielka/gitfold
A few typical use cases: https://github.com/pkukielka/gitfold/blob/main/docs/guide.md
I think in truth I 50% of the reason I made it was because I was mad about Anthropic inventing a whole new vcs after blaming git clone speed. I also knew artifact-fs exists, which works lazily to get data on demand, which is cool. https://github.com/cloudflare/artifact-fs https://news.ycombinator.com/item?id=47792374
this for some reason gives me clearcase vibes...shudder.
jj just makes everything so much easier. But more than that, it has capabilities that are not available in git - eg how it deals with conflicts. There's tons of guides and essays out there about all of this so I won't try to enumerate all the differences
There would surely be some uncomfortable learning period, but it is worthwhile. jjui makes it that much easier too.
Bad ergonomics-- terrible languages, clunky linters, complicated VCS-- can be offloaded to the clanker but the cost is still there. A clanker fighting to un-foobar a git repo is a clanker that spending tokens and coherence on not-the-thing-you-wanted.
One of the best ways I have seen to "clear the head" of a robot is to provide better tooling that requires less cognitive burden-- for the user, or in markdown skills, its all the same.
Clearly other people are delighted with jj though.
Perhaps the value becomes clear on larger teams, big monorepos?
- e.g. tracks everything by default; this is an advantage compared to "oops I forgot to check it in".
- e.g. reworking feature branches is more natural in jj compared to rebasing in git.
I expect I've just internalized all these idiosyncrasies after so long.
I find it incredibly useful as an individual contributor opening many PRs on a single upstream project. I can rebase all my PRs onto new upstream changes in one go, I can easily keep the commit graph neat, I can easily squash changes down into specific PRs while keeping my working tree positioned after they all merge together. Really speeds up my workflow, it's awesome. And it's really cool that merge conflicts don't block operations. It's really limiting that git has only one active branch at a time.
> I probably subconsciously steer away from due to the awkwardness.
I think if I need to rebase a PR enough while waiting for merge that it's a coordination issue and maybe too much churn in the codebase. There shouldn't be a need to do so. Not sure I'd blame git for that.
(Do let me know if this has changed, but I've seen any other kind of merge result in the yellow "Unverified" status on GitHub, as I have the thing turned on that requires all commits from me to be signed with my own key.)
WRT the model: JJ has a DAG of mutable changes. Git has a DAG of immutable commits, a mutable staging area, and a mutable stash.
The rest is probably a bit more of a tradeoff for many people in that jj like git also has a non-traditional mental model that you have to learn, with the difference that there is actually rhyme and reason behind jj's. But whether learning that (which can be a non-trivial effort) is worth it to you if you're already accustomed to git idiosyncrasies is a personal decision.
just treat your stage as the real project and worktree as some ephemeral sandbox. as you work build your index in stages by `git add -e` and removing your debug harness hunks. as soon as you reach a milestone, just commit and type your message when the context is fresh in your head.
with jj, you work all day and finally when you are ready to commit, you now have to manually remove your debug harness, remove build artefacts, and reverse engineer your own code to write a commit message when you just want to go home.
stop treating the stage as a implementation detail poking out into userspace. if it was just a implementation detail, linus wouldn't have defended it so fiercely.
In practice I usually just use `jj commit -i`, where you just select the files you want to keep there, edit / add the description (commit message) and a new change is created on top for your new working area.
> compiler artefacts, build files
I agree with my sibling those should be .gitignored and if not, yes those those may cause problems with `jj`
> debug harness
I think that works pretty well with `jj` actually. Let's say mid work you're interrupted and needs to check a an commit. `abc` is your current working copy and `def` is the commit you want to checkout. You can leave your harness behind (`jj new def`), do whatever you need there, then come back (`jj edit abc`). You can also bring your harness with you with `jj rebase -s @ -o def`. If it's something you commonly use, you can create a change for it and keep it as a parent, and then use a filter to prevent changes starting with a prefix (let's say local:) from being pushed. That said, there are some rough edges about keeping changes as a parent IMO (like having to set up command aliases or keep having to move it, depending on your workflow).
[0] https://steveklabnik.github.io/jujutsu-tutorial/real-world-w...
i have not used jj, but if you are introducing sqaush/new just you get what the stage does cleanly then you are implictly agreeing with the stage model.
> i have not used jj, but if you are introducing sqaush/new just you get what the stage does cleanly then you are implictly agreeing with the stage model.
Squash / new also do it cleanly, just like `git add -e` (I'm not sure what you mean with "cleanly", does it mean "as a special concept?"). And you're right, I agree with the stage model (that's most of the point of my comment!), and I personally think it works pretty well on jj.
I think that's where I disagree with you. Git introduces the staging area (and stash) as separate concepts divorced from the DAG of changes. JJ just has the DAG, and nothing else. I'd say JJ is the cleaner model.
It was not complicated with git either. If there was some important change that I didn't want to commit yet, I stash it. Same with experiments that contained valuable information. Then I can use stash apply whenever I want. Never had trouble jumping around the git graph.
One key thing is that I find that conflicts are a very good signal for when the intent of the worktree at commit c clashes with the intent of patch p. Especially if you've designed the code to follow the single responsibility principle. I don't want to sweep this under the rug. Instead I want to solve it right away.
A lot of jj advocates need to better highlight their workflows and why they think git was not doing well for them. I think there's too much focus on managing files instead of unit of changes (contained in patches).
commits: clean patches that have been integrated somehow (even as a draft version in my local repo)
index: patch in progress (very short lived as I usually add things and commit right after). It's an editing space.
stash: valuable patches in terms of knowledge, but not relevant to any current task
While they look similar, they have different purposes and so interact with different tools.
I code for one purpose (and maybe get distracted for one thing or two) then goes on to clean up the patches and write a proper message. It's not a matter of adding and rejecting hunks. I also do edit them normally. Tooling is not a problem as I spend more time on reading and editing than on tool calls.
Stashing is similar. The patches stored there are individuals, meaning I don't have to worry about dependency when I delete one. I also don't have to worry about location as there's just one stash concept.
You can also find a way to do the same operation in jj, but I want tooling centered around the concept of a patch, not the concept of commits. jj make it awkward to work with patches.
> A lot of jj advocates need to better highlight their workflows and why they think git was not doing well for them.
Yes, I agree. Nowadays I use jj but I had the same feel before trying it, and I do think git usually works fine. What does it for me is just that it makes things simpler and there are fewer commands and special cases. I can use the same command I use to stage things and to move some changes from/to any commit (`jj squash -i`, adding `--from` and `--into` as needed). The same command I use to create a new commit is the one I use to merge (`jj new`, a merge is just a commit with more than one parent). It's super easy to change which commit a branch points to (`jj bookmark move`). With a few commands I can do most things and most of the time I just look at the single page CLI reference[0] to figure it out in a few minutes. I still use git when I need one of the (still) unsupported features, which in my case were submodules and LFS.
> If there was some important change that I didn't want to commit yet, I stash it. Same with experiments that contained valuable information. Then I can use stash apply whenever I want. Never had trouble jumping around the git graph.
Stash: for me, I just find it simpler with jj really. My "stash entries" show up in `jj log` just like everything else, and I immediately know in which parent it's based on. I can use the same commands to deal with the stash as I use for every commit, like I said in the previous paragraph, and I do not need to remember at which index the change was on the stash stack. I can also add a description to it if I want. Surely it's possible to do most of these in git, but in jj I already know how to do all of these as it's the same as any other commit.
> One key thing is that I find that conflicts are a very good signal for when [...] I don't want to sweep this under the rug. Instead I want to solve it right away.
Edit: ah, you're talking about the article. I also don't like leaving conflicts open and I do not use the edit workflow (where you edit commits in history directly). I will either: 1. create a new commit on top of the one I want to edit, then squash and immediately fix conflicts, or 2. work on the latest and squash all the way to the commit I want it on, then fix conflicts. TBF I don't think the way the article does it is too different from what you'd do with git, on git conflicts would only show when you do something like a rebase, a merge, maybe an amend. With the edit workflow it shows up when editing the files. At that point on git you're also "ignoring" the conflicts as you haven't merged / rebased yet.
For me the advantage on `jj`'s conflict handling is that I'll create a new commit on top of the conflicted commit, fix the conflicts there, then review while squashing my fixes (or maybe even comparing to the conflicted commit's parent, with `jj diff --from @--`, this way I can see the whole picture of the fix.
You can also leave it as `none()` and then manually add files as before.
Note also that this has nothing to do with the staging area, but with selecting which files to add to a repo, which other VCSes can do just fine without having a staging area.
In fact, selective auto-track plus not having to explicitly stage changes makes it less of a risk that you forget to add something.
I agree with that, which is why I pointed you at the auto-track setting. I also think that automatically adding everything is a poor default.
> after all software engineering is a craft, so craft you commits.
I could not disagree more. Reliability dictates that you minimize the risk of errors, including those from having unnecessary manual steps for frequently repeated operations.
My point here is especially git vs. pretty much any other VCS aside from jj, not git vs. jj; do not assume there are only two options here. Being explicit about adding files to a repo is generally a good idea. Having to repeat the process for already added files for every commit is just another opportunity for errors.
And as I wrote in another comment [1], I actually consider the staging area an anti-pattern for unrelated reasons.
[1] https://news.ycombinator.com/item?id=50573492
`git add -e` your files as you are satisfied (of course after remove your debug harness). this way you debug harness stays put in your sandbox/worktree and no harness leaks into your project which remains pristine. this is something that .gitignore cannot do. jj cannot. you have remove all your harness, TODOs and others just to commit and then add it back again. that just means your version control failed.
and no, i am not advocating you should no add .gitignore.
No, you don't. You can split. You can untrack. You can change your auto-track configuration. There are many ways to deal with this other than having to remove them. You can be equally deliberate about what goes into your final commit.
You have a much more flexible stage in jj than in git. It's not gone anywhere. They just promoted it to first class and don't call it a stage.
> you have to either write a .gitignore counterpart for jj or manually remove them before committing.
I'll admit it is a pain. The one nice outcome, though, is that you now have everything in .gitignore and don't get "?" in your status.
> just commit and type your message when the context is fresh in your head.
The nice thing about jj is you don't need to worry about the "fresh in your head" part. You can write the commit message before you even begin, and modify it as you go along. You can commit things with no message (which I sort of use as staging), and much later, after several commits, go back and put in the message.
jj gives you the best of both worlds. If you want the friction, you can have it - with no more commands than with git. If you don't want it, fewer commands. And if you want a fancier stage you can have that too.
There's lot's of jujutsu tutorials that teach you how to undo operations and write commit messages before the commit, but almost none cover what to do with all this power.
It's easy to name some general principles like “it should be easy to read” but I don't think it helps, especially if you're a novice like me.
As an example, you might end up with "Refactor to facilitate adding feature X", "Data models for X", "API endpoints for X", "UI for X". Each of those would contain all the code/tests/documentation for each of those steps.
The nice thing about jj is that it makes it really easy to have a bunch of messy commits locally as your bouncing around the place, followed by squashing/splitting things as appropriate. In practice that first refactor commit might only come into existence very late after you've built a bunch of endpoints and done some refactoring along the way.
jj gives you excellent tools to change your mind mid-way.
I wrote a jj skill (https://github.com/mhw/jj-skill) that tries to address both of those issues, and explaining some higher-level workflows like the conflict resolution example I described above. It happily goes through the conflicts creating new commits off them, resolving the conflict, and then squashing the results.
Long-term I'm sure LLMs will have JJ in their training data.
edit: there is! https://tabbyml.github.io/jj-benchmark/
Only gap that I care about is jj workspaces<->git worktrees is not fully implemented. You can now auto create a worktree when you create a workspace, but not the reverse. There's prs for this though. I hope they get merged soon.
Claude is also very good at fixing merge conflicts as well.
I just really with they would add :q as a quit option. Vi has given me brain damage.
Totally guilty to have used AI (Claude Code) entirely to make this learning tool for me, and hopefully for others. There may be errors, please feel free to correct and point out.
jj - taken through a small repository through 24 steps, drawn in 3D. Beside each step is the same step in Git.
https://brajeshwar.com/misc/jj/
That said, I think JJ will get better when it's backing on to something that's designed from scratch rather than backing on to git and forges like Git(Hub|Lab) which really restrict it.
Longer version: if jj was what git had been originally, it would have saved millions of people a lot of pain and annoyance. It's definitely a better tool than git originally was. By now, though, git has gotten reasonably better, and the ecosystem around it has become polished enough, that the nicer, well-thought out UI of jj isn't as much of a slam dunk win anymore. It's still pretty good to work with, but there were enough papercuts for it to be not worth it for me: missing docs and features due to immaturity (presumably/hopefully to a lesser degree by now than back then), the friction of bookmarks interacting with branches in remote git forges, the fact that every throwaway file is committed right away (theoretically optional, practically assumed by every jj workflow out there) so you need to both ignore it and prune it out of history every time, there being `jj <command>`s and `jj git <command>`s that you need to remember which is which - all of these have understandable reasons and are small things, but overall added up to the fact that I felt myself dreading the jj-specific issues more than I enjoyed the upsides of it.
The workflow is straightforward: I create a named revision for the work I want to do, then an unnamed revision on top. I prompt Claude, changes land in the unnamed revision, I review those, squash the parts that I'm ready to accept, prompt some more to iterate on the parts that aren't up to par yet. Rinse and repeat until the topmost (unnamed) revision is empty.
I instructed Claude that I use jj with the squash workflow, so it should never touch revisions with a non-empty description (I also needed to tell it to shut up about that check), and the whole thing flows pretty damn smoothly.
Git and jj work trees are not interoperable, so any tool that assumes git forces you back. Looking at you, Claude app…
Write yourself a very good JJ skill or reference file from your AGENTS.md.
My LLMs struggled with it a lot too, but I slowly covered everything they were messing up and they haven't made a mistake in months now. Even when there are "divergent" issues, it knows how to recover now.
This hasn't been an issue for me for a while now, and I've actually had Opus 5.5 and Gemini Hydrogen build and submit a 28 commit deep stack, with all the reviewing/rebasing/shifting around that entails.
That was the biggest hurdle for me too. I was a 2+ year jj user, then I had to switch back to git because of all the agentic tools relying on it.
I recently went back to jj, after finding a decent skill [1] and discovering Emacs' majutsu plugin. Claude still tries to do a git command every once in a while, but it's a lot more bearable.
[1] https://github.com/netresearch/jujutsu-workflow-skill/
I can say this hasn't always been the case, and until about 2 (maybe 3?) months ago I would handle all the VCS related parts of the work. I would let the agents write code, which I've found less and less necessary to tweak as time has gone on, and write the commit messages and create the PRs by hand.
My colleagues (who use git) let Claude write commit messages, but I find those awfully long-winded and my eyes just glaze over when I open their PRs - but to each their own I guess.
At least the Claude commit messages are an improvement over the commit messages before - I gave up trying to get them to apply the recommendations of how to write good commit messages given in https://cbea.ms/git-commit/
It's a tad opinionated: my agents are not allowed to push to external repos — but that's easy to change if you need
It works totally fine.
But I still miss the number commit references from mercurial...
[0]: https://github.com/edawise/deccy-cli
I proposed it and the team rejected saying jj solves a problem that was solved by LLMs and git, and that it would introduce paper cuts to our workflow.
JJ is much better, and I want the tooling to support it better, but it's not there yet in general.
By default it ignores jj for me and just uses git. The team wasn't eager to add more to the context.
Also I’m sure there’s a joke in here about rollbacks.