When the Monorepo Ate My Laptop: Sparse‑Checkout + Mounts That Made Work Possible

How I stopped syncing a 20GB monorepo to my laptop by using git sparse-checkout and bind mounts into my dev containers — the wins, the setup, and the mistakes.

Written by: Arjun Malhotra

A laptop on a desk with code visible on the screen, a notebook and coffee beside it
Photo by Glenn Carstens-Peters on Unsplash

It was a Tuesday. My laptop fan sounded like a jet engine and Finder showed 8GB free out of 256GB. I needed to test a small change in a payments microservice, but the monorepo insisted I had to fetch everything: frontend, mobile, three services I hadn’t touched in months, and a node_modules folder that remembered the early days of npm.

Pulling the full repo over my flaky home broadband took 20 minutes. Building the container? Another 12. My iteration time — make a change, rebuild, test — was five slow, dispiriting loops. I kept deferring the task. That’s productivity theft.

So I stopped pretending my laptop should host the whole codebase and moved to a simple constraint-driven workflow: check out only what I need, and mount that into dev containers. Sparse-checkout + bind mounts. The idea is dumb-simple and effective. Here’s how I did it, what actually improved, and the screw-ups that saved me time later.

Why sparse-checkout in 2026

Sparse-checkout lets me have the repo metadata and the folders I actively work on, without pulling every nonessential file. That alone cut the checkout time from 20 minutes to ~90 seconds for me.

The pattern I settled on

  1. Keep a small “bootstrap” clone on my laptop using sparse-checkout (git sparse-checkout set …)
  2. Run the heavyweight stuff — full builds, integration tests, npm installs — in a local container or small Raspberry Pi/home server that has the full repo and caches
  3. Bind-mount the sparse files I edit into that container so the container sees live edits and rebuilds rapidly

My working commands (fares well for Linux; I use WSL2 sometimes):

Why this beats just editing locally

Real wins I saw

The parts I misjudged (my failures)

Tradeoffs I accepted

A few tiny scripts that saved my sanity

When to try this

When not to

What I actually walked away with Sparse-checkout + mounts didn’t make my repo smaller. It forced me to acknowledge a constraint — my laptop cannot be everything. By accepting that, I got two real things back: faster iterations for the work I do most, and a quieter laptop that doesn’t sound like a blender. The tradeoff is more orchestration (scripts, a small host), but for me that orchestration is a one-time tax that pays off every time I avoid a 20-minute clone.

I still sometimes pull the full repo on my home server and watch it silently chug npm installs at 2am. It feels luxurious. My open question: if you work mainly on frontend UIs in a large mono, how have you handled live visual feedback without cloning everything? I’m still experimenting.