TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Git Alternatives – Sapling vs. Jj

94 pointsby koch6 months ago
Having worked at Google I have unfortunately been exposed to what is possible when in comes to version control systems. I have been looking for a git alternative that is just generally simpler, more ergonomic, and allows for things like stacked PRs while maintaining git compatibility, since everything is on github.<p>I am uninterested in `you can do that in git with [insert esoteric commands]`.<p>My main contenders right now are Sapling[0], a project from Meta, and jj[1]. I am wondering if anyone has experience with either, or definitely those who have tried both, what was your experience? They both have a lot of nice features.<p>[0] https:&#x2F;&#x2F;sapling-scm.com&#x2F; [1] https:&#x2F;&#x2F;github.com&#x2F;martinvonz&#x2F;jj&#x2F;blob&#x2F;main&#x2F;docs&#x2F;sapling-comparison.md

24 comments

IshKebab5 months ago
There&#x27;s also Pijul. I have only had a brief play with Jujutsu and I haven&#x27;t tried Sapling but from what I can see, Jujutsu is definitely the best option if you want to actually get stuff done while mostly maintaining Git compatibility.<p>Pijul is definitely still in the research prototype phase, and definitely not Git compatible. I don&#x27;t know how Git compatible Sapling is, but large parts of it are still labelled &quot;Not yet supported publicly, OSS is buildable for unsupported experimentation.&quot; It also <i>feels</i> like a VCS that was designed for Facebook and then open sourced, so it is targeted at the use case of &quot;massive company monorepo, and we have 10 guys that run the infra&quot;. That&#x27;s great, because Git is bad at that use case, but it might not be what you want.
评论 #42379183 未加载
评论 #42382364 未加载
Zambyte5 months ago
Jujutsu replaced git for me in February of this year, except for managing tags, which I reach for the git cli for in my colocated repositories. I find it is much easier for me to create a sensible set of revisions that linearly approach my desired state for the working directory, even if I did not linearly arrive there.<p>I also use features of jj that are not available in git all the time, like rebase -s (rebase a tree from the root), split (turn one revision into two), absorb (cascade changes into a stack of revisions where the lines were last modified), etc.<p>Given how stable git is as a repo format, I find it unlikely that I will ever go back.
neongreen5 months ago
At work I’ve been using jj for the internal Standard Chartered monorepo (6.5 MLOC). I didn’t ask anyone, just installed and started using it. Git compatibility is a killer feature.<p><i>(if anyone from SC is reading this -- search our wiki for &quot;Jujutsu&quot; and come say hi!)</i><p>Pretty much a strictly better experience than git so far — I’m not going back. `jj undo` is something that I expect in <i>every</i> program now and get vaguely annoyed it&#x27;s not there.<p>Not having index&#x2F;staging is great. Checking out another branch, switching to work on another thing, fixing a typo in an unrelated module, etc are all frictionless. &quot;I&#x27;ll insert a new commit five-commits-ago, do the refactoring there, and resolve conflicts&quot; turns out to be much nicer than &quot;I&#x27;ll do the refactoring here and carefully stage it hunk-by-hunk&quot;. (I get distracted a lot -- maybe if you aren&#x27;t tempted by shiny refactorings, this isn&#x27;t a big deal for you.)<p>The merge story is also great. I have a commit with multiple parents. I can add more parents to it, change parents, rebase it somewhere, move it around. I have no idea how &quot;rebasing a merge&quot; works in git, but I&#x27;m afraid to try. In jj I don&#x27;t care.<p>There are a few issues with jj that happen to not be a big deal for me, but I can imagine they could be a dealbreaker for someone else:<p>- No submodules support (yet)<p>- No LFS support (yet?)<p>- Doesn&#x27;t track renames (yet?)<p>- When you do `git pull` with rebase, git skips duplicate commits -- this is great if something got rebased&#x2F;amended on the remote. I was always suspicious that `git pull` just works even if I rebased the branch remotely, and now I know why it works. jj doesn&#x27;t handle this yet. Not a big deal unless two people collaborate on a branch and want to do it the jj-way with rebases of everything.
评论 #42392268 未加载
mk125 months ago
I just started a new job where I’m collaborating with the maintainers of mercurial, and was asking them about these alternative VCSs last night. It was interesting to learn that all these people are in contact with each other and there’s a lot of cross pollination of ideas. And for some newer ideas e.g. in jj and pijul, where just reading the website would have me 100% sold, they had more nuanced takes on the pros and cons. So I feel less confident in giving advice than I would have a few days ago. But if you need seamless git compatibility, I’ve personally found git-branchless to be the best solution for the requirements you listed as a thin layer over git. I also tried jj a while back and I liked it but I found being further removed from git made it harder to drop down into regular git when I needed to. In particular I had issues with jj log showing lots of irrelevant commits but that was probably because of our particular Gerrit setup and might have been fixed by now.
eawgewag5 months ago
JJ is incredible. Highly recommend it. I can&#x27;t put into words what a game changer it is for my workflow.<p>The only thing I reach for for git now is `bisect` when I need to debug an oncall issue.
评论 #42382606 未加载
评论 #42380727 未加载
ghjfrdghibt5 months ago
I like fossil. Much prefer it to git. No idea what stacked PRs are but it&#x27;s compatible with git and way simpler in my opinion. Plus comes with some nice extras like tickets, wiki, UI.
评论 #42380868 未加载
评论 #42380966 未加载
barlog6 months ago
[1]: &lt;<a href="https:&#x2F;&#x2F;github.com&#x2F;martinvonz&#x2F;jj&#x2F;blob&#x2F;main&#x2F;docs&#x2F;sapling-comparison.md">https:&#x2F;&#x2F;github.com&#x2F;martinvonz&#x2F;jj&#x2F;blob&#x2F;main&#x2F;docs&#x2F;sapling-comp...</a>&gt;
ksec5 months ago
Off topic. I saw this thread the other day and thought it will be an interesting topic. But then it dropped off and disappeared. I doubled checked the topic was 2 days ago but now it reappeared as 2 hours ago. Anyone knows why?
评论 #42379442 未加载
评论 #42379270 未加载
mhh__5 months ago
I have been using `git-branchless` a lot and really liking it. It should be part of the main git project, consider it a halfway between git and switching to some other tool.
评论 #42380690 未加载
riedel5 months ago
Lots of discussion on this jj post: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=36952796">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=36952796</a>
xrd5 months ago
A question: I prefer jumping into the command line for most of my git work. But, I&#x27;m intrigued by this discussion and wonder: how well do these tools work within an editor? I am using Zed, which IMHO has poor git support anyway. I&#x27;m curious if the experiences here are mostly from people who do not use their editor as their main point of contact with the code repository they are working on.
评论 #42379992 未加载
评论 #42386612 未加载
评论 #42380731 未加载
Lanedo5 months ago
For a quick impression, the jj-fzf README has a number of screencasts that showcase tasks easily accomplished with jj (using fzf to preview the jj log and key bindings to invoke jj commands):<p><a href="https:&#x2F;&#x2F;github.com&#x2F;tim-janik&#x2F;jj-fzf?tab=readme-ov-file#splitting-commits">https:&#x2F;&#x2F;github.com&#x2F;tim-janik&#x2F;jj-fzf?tab=readme-ov-file#split...</a><p>(Another self-promotion)
drcongo5 months ago
I tried jj recently based on a sub-thread here on HN, have to say I did really like it, but still came away feeling like it was going to take a lot to train the muscle memory away from git.<p>Edit: Here&#x27;s that sub-thread: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=42112574">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=42112574</a>
HALtheWise5 months ago
If you&#x27;re looking for a polished way to manage a stacked-PRs workflow with git and GitHub, I highly recommend Revup. It was invented at Skydio when I worked there, and quickly developed a cult following among engineers there. I wouldn&#x27;t describe it as simpler than default git, especially since you still mostly use git commands (like rebase -i) for lots of tasks, but for power users it provides a really nice workflow.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;Skydio&#x2F;revup">https:&#x2F;&#x2F;github.com&#x2F;Skydio&#x2F;revup</a>
arxanas5 months ago
For me, the most interesting differentiating factor at this point is probably the GUI tooling for Sapling. Try out their &quot;interactive smartlog&quot; and see if it resonates with you.
SatvikBeri5 months ago
I switched to jj about a month ago and love it.<p>Broadly speaking, commits in git represent two conflicting ideas – a mechanical representation of the state of the codebase, and a logical series of changes for bisecting and human readability. It&#x27;s <i>possible</i> to manage this in git, but painful.<p>In jj, these two concepts are separated – you have Revisions which represent the mechanical state, and are saved every time you run any command, even `jj status`. And you have Changes, which represent the human readable stuff, and can be edited at any time. This makes it really easy to save lots of snapshots, while carefully crafting your Changes for a readable history.<p>I was surprised at how easy it was to adapt to jj. It didn&#x27;t feel like I had to learn a lot of stuff or a big new mental model, it turns out to just be pretty simple to craft the Changes at any point I please.
EddieRingle5 months ago
&gt; I am uninterested in `you can do that in git with [insert esoteric commands]`.<p>Why? If the only requirements you specified are that you&#x27;re looking for something that is compatible with Git but with better ergonomics, wouldn&#x27;t something that wraps Git (whether that&#x27;s via aliases or something more comprehensive) fit the bill?
评论 #42379984 未加载
评论 #42380086 未加载
Flux1595 months ago
I&#x27;ve been using Sapling along with the VSCode extension for ISL which mostly gets me a better workflow with diff stacks locally (Github isn&#x27;t great dealing with stacks though).<p>The only major limitation for me is git-lfs support so for certain repos I have to revert to git.
brudgers5 months ago
Documentation, training, and relative ease of acquisition and installation are properties of the git ecosystem that are hard to replicate outside of an organization with a business case like Google.<p>That&#x27;s the setup for: Who are the intended users and in what context will they use it?<p>If it&#x27;s just you or you and your employees, selling no github can be straightforward. If it&#x27;s your boss and some other teams, it&#x27;s gonna be harder. Good luck.
评论 #42379131 未加载
评论 #42378907 未加载
评论 #42385667 未加载
johnisgood5 months ago
Opinion on Darcs or Pijul?
aseipp5 months ago
I&#x27;ve used both quite a bit, first Sapling and then Jujutsu, and now I exclusively use Jujutsu and am one of the developers. I previously used Git almost every day for ~15 years. Frankly, I think you&#x27;ll be very happy with either of them; they are pretty much straight upgrades from Git in most ways. Some notes (random, non-exhaustive):<p>Both of them are heavily Mercurial inspired; Sapling is a heavily evolved fork of Mercurial, while Jujutsu was strongly inspired by many of its concepts but shares no code (the two main developers, Yuya Nishihara and Martin von Zweigbergk, are former heavy hitting Mercurial developers.) They support features like revsets, filesets, have a notion of &quot;changeset evolution&quot; built into their internal models, and more.<p>These features actually make it possible to do things in an &quot;open ended way&quot; that would be difficult or not-possible to do in Git; something like finding all commits with &#x27;description(foo) &amp; author(aseipp)&#x27; for instance is not something I&#x27;m sure you can do in Git in a one-off way, as a counterexample to the &quot;just run this command in Git to do that!&quot; argument.<p>Both of them have a significantly simpler conceptual model because they replace concepts like &quot;stashes&quot; or &quot;the staging area&quot; with commits. To be clear: you can do all the things you like with Git, but with less conceptual overhead. There are fewer &quot;nouns&quot;, and consequently fewer &quot;verbs&quot; you need to use and memorize.<p>They also don&#x27;t tend to muddle a bunch of stuff together under one name; rebase is just rebase, not &quot;rebase and edit commit message and reorder and throw away commits and merge commits and ...&quot; like in Git. Or consider `git revert` and the dozen options that make it work on this-or-that. This and the previous point mean their UX is also much smaller than Git, a bit more clean and well separated, etc.<p>Jujutsu has an even <i>further</i> simplified model because it doesn&#x27;t even have a concept of things like &quot;the working copy.&quot; Everything is a commit. This has a large list of downstream consequences on things like performance (jj rebase is vastly more efficient than git rebase), internal design choices, etc but the takeaway is that you have an even simpler cognitive model. The flipside, I think, is that Jujutsu might take slightly longer to &quot;internalize.&quot;<p>Both of them have the ability to expose the `.git` directory next to their own VCS directories (.sl and .jj) so your existing tools like showing status lines in the editor gutter can work. Jujutsu calls this &quot;colocation&quot;, and Sapling calls it &quot;dotgit&quot; mode. Sapling&#x27;s &quot;dotgit&quot; mode is still experimental; Jujutsu&#x27;s colocation mode is well supported, and likely to become the default in the near future.<p>Both of them have &#x27;undo&#x27; commands. Imagine that! A command that can undo your mistakes! Users are almost always universally filled with joy when they discover this feature.<p>Both make workflows like stacking or rebasing a lot easier, conceptually, so you will probably be happier with either. Sapling has ReviewStack so you can do stacked reviews a bit more clearly on GitHub. For Jujutsu we don&#x27;t integrate with ReviewStack, or Reviewable&#x2F;Graphite (yet), so you are still at the mercy of Github&#x27;s review tools, which are a bit weak when it comes to interdiffs&#x2F;stacked PRs.<p>Sapling has a command called &quot;interactive sapling&quot; or &quot;isl&quot; which is a web-browser based GUI that you can use to drag and drop, reorganize, split, restack commits with ease. isl is an incredible tool, it is easy to use even for newcomers, and I consider it a major advantage over Jujutsu!<p>Jujutsu has the notion of &quot;first class conflicts&quot; which make most forms of conflict resolution far easier. It&#x27;s a bit difficult to explain but think of `git rerere` combined with `git rebase --update-refs`, but on steroids. I consider this to be a major advantage over Sapling.<p>Sapling is the VCS of choice at Meta, and they are working on making the scalable server-side components available too. Jujutsu is designated to (hopefully) become the true successor to &#x27;fig&#x27; at Google, which I suspect you&#x27;re familiar with. Maybe this matters to you as a former Googler, but maybe not. (Note: I do not and have never worked at Google, but Martin does and is the leader of this effort.)<p>Jujutsu actually exposes a set of APIs so you could in theory use it with other backends; that is how the Piper&#x2F;CitC integration at Google works, and people have floated ideas like a Mercurial backend, for instance. In theory it is extensible, but this might not matter to you.<p>Jujutsu is a pure Rust codebase, having been written from scratch, while Sapling has a much longer history; it is a mix of Python and Rust. I personally think this makes it much easier to contribute to Jujutsu, and it was one of the reasons I switched because I personally tend to write patches for tools I use. OTOH, Sapling is much more refined in some ways. It is up to you if you think this matters.<p>Compatibility-wise, I believe Sapling uses `git` commands underneath to drive a lot of its features, while Jujutsu instead uses libgit2&#x2F;gitoxide for interop. IMO, libgit2 has caused us and users a few issues long-tail issues that are hard to resolve; things like Git Credential Manager or OpenSSH config support for instance don&#x27;t work as well with libgit2, which causes annoying bugs. Other features like partial clones don&#x27;t work (shallow clones do.) You can just use `git` commands to work around this, typically, but I think Sapling might handle some of these quite a bit better.<p>In short, I think you&#x27;ll probably be happy with either of them. If you have any questions about Jujutsu at least, you can open them on GitHub, Discord, IRC, etc.
评论 #42379826 未加载
optymizer5 months ago
I learnt Sapling while at Meta. I was skeptical when someone said &quot;it&#x27;s better than git&quot; but then I used it and I will in turn now say that it&#x27;s indeed better than git. At the very least it doesn&#x27;t yell at you for not being on a branch and losing code, but it has easy commands for working with a source tree and working with diff stacks. I haven&#x27;t used it outside Meta&#x27;s infrastructure though.
findjashua5 months ago
Shameless self-promotion: <a href="https:&#x2F;&#x2F;pypi.org&#x2F;project&#x2F;stacksmith&#x2F;" rel="nofollow">https:&#x2F;&#x2F;pypi.org&#x2F;project&#x2F;stacksmith&#x2F;</a>
评论 #42383591 未加载
keybored5 months ago
&gt; Having worked at Google I have unfortunately been exposed to what is possible when in comes to version control systems.<p>Do you also drink your tea by sticking your pinky out?