Branch-per-environment versus directory-per-environment for GitOps: how do you decide?
AdvancedProductionBranching and workflow design
Answer
We use directories (or overlays) on a single branch. Branch-per-environment (dev, staging, prod) makes promotion a merge that carries unrelated changes, hides drift between environments and complicates hotfixes. Directories give a reviewable diff for what differs between environments and one history. Argo CD or Flux tracks a path per environment.
apps/payments/base
apps/payments/overlays/dev
apps/payments/overlays/prod
More on Branching and workflow design
How would you choose a branching strategy for a team of 40 engineers shipping a SaaS product several times a day?IntermediateWhen is GitFlow still the right choice in 2026?IntermediateHow do you support multiple released versions (1.x, 2.x, 3.x) without chaos?AdvancedHow do feature flags change your merge and release process?IntermediateWhat branch naming and commit conventions do you enforce and how?BeginnerSquash, merge commit or rebase: what do you set as the allowed method on production repos and why?Intermediate