Build a safe GitOps workflow: a comparison of trunk-based and GitFlow, environment directory structures, branch and tag promotion strategies, and PR-based change management.

In episode 14 we scheduled when syncs may happen with Sync Windows. Now all the technical components are complete — Application, Project, ApplicationSet, Secrets, Hooks, and Windows. But there's one layer that's often forgotten and actually determines a team's success: the human workflow around Git. How do changes flow from a developer's laptop to the production cluster? In this episode we discuss GitOps Workflow & Branch Strategies — the repository, branch, and promotion patterns that make Git truly an organized source of truth.
Why does this matter? ArgoCD only does what's in Git. If the Git structure is messy, the result is messy deployments. Conversely, a well-organized GitOps repository is part of the control mechanism: every change is reviewed, documented, and easy to roll back — exactly what's needed for audits and operations at scale.
There are three major patterns determining how teams write changes:
All developers work on a single main branch (usually main), with features developed in short-lived branches that are quickly merged via PR. Advantages: continuous integration, minimal conflicts, and a linear history. This is the pattern best suited to GitOps because ArgoCD syncs one clear targetRevision.
Uses the develop branch as the development center with feature/* + release/* + hotfix/* branches around it. More structured for big releases, but heavier: changes must pass through several branch levels, and this often makes GitOps configuration duplicative.
An intermediate pattern: one branch per environment (dev, staging, prod). ArgoCD in the dev environment syncs the dev branch, and so on. Promotion is done by merging between branches. Release branches (release-1.2) are used to lock the version being released — well combined with tags.
Besides branches, the directory structure determines the scale of a GitOps repository. Three common approaches:
gitops-repo/
├── apps/
│ ├── billing/
│ │ ├── base/
│ │ ├── overlays/
│ │ │ ├── dev/
│ │ │ ├── staging/
│ │ │ └── prod/
│ └── orders/
└── clusters/
├── dev/
└── prod/Every application has a base (default) and per-environment overlays. Promotion = adding or changing an overlay. This is the most common and easiest-to-understand pattern.
gitops-repo/
├── clusters/
│ ├── eks-prod/
│ │ ├── namespace-billing/
│ │ ├── namespace-orders/
│ │ └── platform/
│ └── kind-staging/
│ ├── namespace-billing/
│ └── namespace-orders/
└── apps/
└── shared-charts/Promotion is the process of moving a change from a lower environment to a higher one. Four strategies:
| Strategy | Mechanism | Advantages | Disadvantages |
|---|---|---|---|
| Branch promotion | Merge branch dev to staging to prod | Simple, follows GitFlow | Conflicts between environments |
| Tag-based | Release tagged v1.2.3, prod refers to the tag | Reproducible, versioned | Requires tagging discipline |
| PR promotion | Every promotion goes through PR + review | Fully reviewed, clear audit | Takes time |
| Overlay-based | Kustomize/Helm overlay bumps the image version | Per-application precision | More complex initial setup |
The pattern highly recommended for production is tag-based + PR promotion: the team promotes by creating a PR that changes the image version in the prod overlay to a specific tag, and ArgoCD only applies it if the PR is approved.
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: ghcr.io/devnull/billing-api
newTag: v1.2.3This part is what makes GitOps excel at governance:
CODEOWNERS (e.g. the platform team) and require approval — can be reinforced with CI status checks.argocd app rollback for a previous state). Since manifests are versioned, reverting is always possible and documented.Tip
Keep the GitOps repository and the application repository as two separate repositories: the app repo contains code, the GitOps repo contains manifests. This isolation lets permissions differ — developers can change code, but only leads can change production manifests.
prod branch merged manually without a clear promotion flow quickly diverges from staging. Standardize the promotion flow.git push --force to "make changes disappear"; use revert so the audit trail stays intact.latest is hard to roll back and not reproducible. Mandate semver (we dive into this in episode 16).This episode summarized the human side of GitOps: the comparison of trunk-based, GitFlow, and environment branches, environment-based/application-based/cluster-based directory structures, branch/tag/PR/overlay promotion strategies, and change management through PR reviews, approvals, change tracking, and rollback procedures.
The points you should take with you:
Keeping image versions in sync between environments manually is very tiring. In the next episode 16 we discuss Image Updater - Automated Image Updates: installing ArgoCD Image Updater, semver/latest/digest strategies, write-back to Git, and patterns from automatic dev to manual approval in production. See you in episode 16!