What is a Monorepo?
A monorepo (monolithic repository) is a version control strategy where the code for multiple projects, libraries, or services is stored in a single repository, enabling shared tooling, atomic cross-project changes, and simplified dependency management.
How Does Monorepo Work?
Instead of maintaining separate Git repositories for each project, package, or service, a monorepo consolidates everything into one repository. This approach is used by major technology companies like Google, Meta, and Microsoft. In a monorepo, developers can make atomic commits that span multiple packages simultaneously — for example, updating a shared library and all its consumers in a single pull request — ensuring consistency and reducing integration issues.
Monorepo tooling has matured significantly, with build systems like Turborepo, Nx, Bazel, and Lerna providing features such as incremental builds (only rebuilding what changed), remote caching (sharing build artifacts across the team), task orchestration, and dependency graph analysis. While monorepos offer advantages in code sharing and refactoring, they require specialized tooling to handle the scale and can present challenges with repository size, CI/CD pipeline complexity, and access control for teams that need visibility boundaries.