What You'll Learn
You'll learn how to organize Git repositories for GitOps using monorepo, polyrepo, and hybrid patterns to scale effectively across teams and environments.
The Repository Organization Challenge
When implementing GitOps, one of your first decisions is how to structure your Git repositories. This isn't just about folder organization—it's about defining team boundaries, blast radius, access control, and deployment workflows. Think of it like deciding whether to run one massive warehouse or multiple specialized shops.
Three Core Patterns
Monorepo Pattern
A single repository contains all applications, environments, and configurations. Everything lives together in structured directories (e.g., /apps/frontend, /apps/backend, /envs/prod, /envs/dev).
Pros: Atomic changes across services, simplified dependency management, single source of truth.
Cons: Slower clones, complex RBAC, potential for wide-blast-radius changes.
Polyrepo Pattern
Separate repositories for each application, team, or environment (e.g., frontend-app-gitops, backend-app-gitops, platform-config).
Pros: Clear ownership boundaries, isolated access control, independent versioning.
Cons: Coordinating multi-repo changes is harder, potential for configuration drift, more repos to manage.
Hybrid Pattern
Combines both approaches—often a monorepo for platform/infrastructure configs and polyrepos for application-specific manifests. Or, shared configs in one repo with app-specific overrides in separate repos.
Pros: Balance of control and flexibility, matches organizational structure.
Cons: More complex to design initially, requires clear conventions.
Choosing Your Pattern
Consider your team size, deployment frequency, security requirements, and how tightly coupled your services are. Monorepo works well for small teams and tightly integrated systems. Polyrepo suits larger organizations with clear service boundaries. Hybrid helps when you need both platform consistency and application autonomy.
Key Takeaway: Your GitOps repository pattern should mirror your organizational structure and deployment boundaries—monorepo for unified control, polyrepo for team autonomy, or hybrid for balanced governance.