Blog

Building a Git Client in Rust, With No Rust Experience

December 13, 2025

Over the past few months I’ve been on a bit of a rust adventure. I’m not a systems programmer (I do code review/management), but I grew frustrated with existing git clients not handling massive rebases on windows gracefully.

So I decided to prototype my own. One of my options was some language called rust which had something called tauri, which was said to be faster than electron, so that seemed good enough for a quick weekend test.

At this point, I have never read a line of rust. (or react!) I did know rust had something to do with crabs though.

Looking back, this turned out to be a great choice.

6 months later - I have Git Cherry Tree - a git client which can load the linux repo, diff tens of thousands of files, and load a 1 million lines long file without any effort.

I feel really happy using it myself, and I’m finally brave enough to share it. It’s still in early alpha, but hopefully you will find it interesting!

Here is what I ended up with

  • Rust with Tauri (using react) for the frontend
  • git2 (libgit2) for most but not all git stuff
  • 25k lines of code (12k rust, 13k typescript)
  • Fairly simple CQRS model with some single writer queue for write operations
  • Single ~11mb executable with no installation

Thoughts on my adventure

I didn’t think much of it at the time, but I had a surprisingly easy time getting there. A lot of issues I should have had, didn’t happen. I didn’t think pretty much at all about memory, or managing my threads, or dealing with many cursed problems that I’m used to dealing with at work. It’s a bit hard to point at all the problems I didn’t have, but in practice this looks like me writing code and it just keeps working.

Early on, I put in some error catching code. Since then, I’ve had literally one crash in all the months I’ve worked on this. It was a buffer overflow in libgit2, when you try to diff a binary file. So the only time I had a crash was when C code was called out to. There is some value in that.

Another thing I quite liked is that I could throw something together quickly with libgit2, but if that wasn’t fast enough I could write some rust code, and the performance is way better suddenly. A couple of examples are exact rename detection (~20x faster) and a custom revwalker (~40x faster, with caching). I have this dial I can turn between dev speed and program speed, so I can get features in fast and know I can always make them go fast too. This feels nice.

I have to say I am somewhat of a rust enjoyer now :>

Thoughts on rust as a language

  • I have discovered that I rather like tagged unions.
  • match statements which compile error if you don’t cover all cases are great. I didn’t realise I needed these.
  • I was a bit put off by everything returning results, but after I found the ? syntax I found it nice to work with. As a result I have an almost entirely panic free codebase and every imaginable error shows up as a non blocking popup for the user.
  • I have heard of the borrow checker being a friction point for people, but for me I found I didn’t have much trouble with that or lifetime issues
  • I do have a hard time with the type system though :< Maybe that’s the libgit library but there sure is a lot of type stuff going on and I feel like I need a zoo of methods to get a commit id out for example.
  • I did enjoy making a couple of my own types for commit ids and such, and have them auto convert from strings (needed for tauri frontend) automagically.
  • The rust language server thing shows you types in grey. This is amazing, actually. I was used to always writing explicit types to be able to read your code, but here you get both the visibility and also can just change types and not change other code.

Overall I got the impression that rust is great for beginners. There is all this stuff to help you really reach beyond your means and make code that would ordinarily be far too ambitious or difficult. The language features are nice, but it’s also documented, and there’s cargo which has all these tools in it for you, it really does come together somehow.

Going back to other languages is sad now :<

If you want to see it in motion, the site has videos.

This post was the very beginning of the adventure, after which I published the client for download, added cross platform support, made many more things indeed, and put this very post on this page after having it on reddit.

Check out the other posts on the blog for more things that were done after this!

Enjoyed this? Get notified about Git Cherry Tree updates: