- Developers work in feature branches and collaborate via pull requests.
- When changes are merged into the main branch, a CI pipeline builds and tests the application, produces artifacts (for example, container images), and pushes them to a registry.
- The CI process also updates the declarative configuration that represents the desired state (Kubernetes manifests, Helm charts, Kustomize overlays, or Jsonnet) in a Git repository.
- A GitOps operator (agent/controller) running inside the target cluster continuously watches the Git repository, pulls the updated manifests, computes the diff against the cluster’s actual state, and applies only the required changes to reconcile the cluster with Git.

When the CI pipeline builds and pushes a new Docker image, it usually also updates the Kubernetes manifests (or a separate manifests repo) to reference that image. The GitOps operator observes the new commit, fetches the updated manifests, and applies them to the target cluster(s), bringing runtime state in line with the repository.

git revert <commit>). The operator will detect the reverted desired state and reconcile the cluster back to the prior stable configuration. This makes every deployment auditable through standard Git history and enables simple, reliable rollbacks.
Useful links and references
- GitOps overview (Weaveworks): https://www.weave.works/technologies/gitops/
- Flux (GitOps operator): https://fluxcd.io/
- Argo CD (GitOps operator): https://argo-cd.readthedocs.io/en/stable/
- Kubernetes documentation: https://kubernetes.io/docs/
GitOps combines declarative infrastructure, Git-based versioning, and an automated pull-based operator to provide a provable, auditable, and self-healing delivery model. Git stores the canonical desired state and the operator continuously enforces it in the cluster.