Interview Prep/GitOps & Argo CD/OutOfSync Loops & Diff Problems

An app shows `OutOfSync` with the message `ComparisonError: ... unable to resolve 'main' to a commit SHA`.

BeginnerTroubleshootingOutOfSync Loops & Diff Problems
Answer

Likely causes → The branch or tag in targetRevision does not exist (renamed to master/main, typo, deleted tag).

Diagnose →

git ls-remote https://github.com/org/cfg.git | grep -E 'refs/heads|refs/tags' | head
argocd app get web -o yaml | yq '.spec.source.targetRevision'

Fix → Correct targetRevision or recreate the tag.

Prevent → Use HEAD for default-branch tracking, and protect release tags from deletion.

All GitOps & Argo CD questions Roadmap: Argo CD (GitOps)

More on OutOfSync Loops & Diff Problems