Uber's GitFarm turns Git into a shared service for monorepos
· Do Minh Tuan · Developer Corner 💻
Uber has built something called GitFarm, which it describes as Git-as-a-Service for its monorepo. Instead of every build, bot and automation script cloning the repository, those systems ask GitFarm for the part they need, and GitFarm handles the Git work centrally.
The problem it solves is easy to underestimate if you have never worked in a giant monorepo. A normal repository clones in seconds. A monorepo holding thousands of services can be tens or hundreds of gigabytes, and a full clone pulls the entire history of everything. Do that across a busy CI system all day and you have a storage and network problem that grows with every service added.
The write-up lists the usual cast: prewarmed checkouts, ephemeral sandboxes, repository synchronisation, and gRPC streaming for moving data between GitFarm and the services that need it. gRPC is a fast binary protocol for service-to-service calls, which matters when the payload is source code.
The clone is the wrong default
Git is fine. Nobody needs a better version of it. The bottleneck is an assumption baked into almost every tool: that a job starts by cloning a repository.
I understand why the assumption was reasonable when repositories were small and jobs were rare. It stops being reasonable when the repository is enormous and the jobs are constant. GitFarm replaces the assumption with a service that already has the code, already has common checkouts warm, and can hand out a working copy without the full history.
Uber calls the warm checkouts prewarmed, and I like the word. A checkout for a common branch is kept ready, so a build does not pay the cost of preparing it from scratch. For a rarely used branch, the service prepares it on demand. That is a cache with a policy, and the policy is where the engineering lives.
I think the ephemeral sandbox piece is the other half. Some operations need a throwaway environment where a task can run without touching anything else. Giving each of those its own isolated space, created and discarded on demand, is the difference between a platform that scales and one that accumulates half-broken state.
Why most teams should not build this
I would resist the urge to copy the architecture. GitFarm is a platform-team project, and it only pays off when the monorepo is genuinely large and the automation is genuinely constant. A company with one repository and a dozen pipelines has a problem that a faster CI runner solves.
What is worth copying is the diagnosis. Before adding infrastructure, find out where the time actually goes. The candidates are the clone, the dependency install, the test run and the queue for a runner. Teams often assume the clone because it is the first thing they see, and then build an elaborate caching system for a step that was never the problem.
There is a cheap version of the same idea I would try first. A shallow clone with depth one gets the latest commit without the history, which is usually all a build needs. A sparse checkout lets you pull only the directories relevant to a job instead of the whole tree. Both are standard Git options, and together they remove a surprising amount of the cost that GitFarm exists to solve.
They are not free. A shallow clone makes some history-dependent operations fail, and a sparse checkout needs someone to maintain the path rules. If you use them, put the rules in the repository and review them, or they rot quietly.
Repository synchronisation sounds boring and is the thing that makes the rest work. If GitFarm's internal copies drift from the real repository, every service that trusts it is working from a stale view. Keeping those copies consistent, and being able to prove it, is the unglamorous core of the product.
That is also the part I would press on. A service needs to know the checkout it received is current. Then there is what happens when a branch is force-pushed or a large file is rewritten, and how the system recovers when a synchronisation job fails halfway. None of those are hypothetical failures, and the answers decide whether the cache is a convenience or a source of confusing bugs.
Those are the questions I would ask before trusting a shared cache, because its failure mode is worse than a local clone's. A slow clone is annoying. A shared checkout that is silently stale produces builds that pass against code that no longer exists.
Uber's story is a good example of a category of work that rarely gets celebrated: removing friction that everybody has accepted as normal. Nobody wants to optimise the first two minutes of a build. Everybody feels those two minutes, several times a day, across thousands of engineers.
For a team in Vietnam running delivery for a large client, the practical version is smaller. Measure where your pipeline spends time, fix the top one, and write down the baseline. The specific tool matters less than the habit of treating developer time as a cost you can see.
What I would watch
The question I am watching is whether GitFarm's ideas show up in ordinary tooling. Prewarmed checkouts and centralised Git services are the kind of thing that should become a feature of CI platforms rather than a system each large company builds for itself.
Until then, the takeaway is a question worth asking in any architecture review: how many copies of this repository exist right now, and who is paying for them. I doubt most teams can answer that without looking, which is the point.
Written with AI assistance, reviewed and edited by Do Minh Tuan.