Question:

What is a monorepo?

A monorepo is a single git repository that holds multiple projects or packages, rather than having a separate repo for each one.

Most teams keep each project in its own repository, and that works fine most of the time. If you find yourself with constant overhead from coordinating pull requests across multiple repos, keeping shared packages in sync, and bumping versions everywhere, that’s when a monorepo is worth considering. It lets you make changes across many packages in a single commit and keep everything in lockstep.

Big tech companies have used monorepos for years. Google famously keeps almost all of their code in a single repository. Meta and Twitter have done the same. Turborepo and Nx have made the approach more accessible for smaller JavaScript teams by handling build caching and only running tasks for packages that actually changed.

I generally prefer keeping projects in separate repositories. It keeps things focused and easier to reason about. A monorepo adds tooling complexity that usually isn’t worth it unless you’re genuinely feeling the pain of managing changes across many repos.

You might also like