Skip to content
Latchkey

argocd app sync: Deploy an Application

argocd app sync applies the desired Git state of an Application to the cluster and waits for the operation to finish.

sync is the deploy verb. In a pipeline you trigger it after pushing manifests and then gate on its exit code, which is non-zero if the sync fails.

What it does

argocd app sync reconciles the live cluster state toward the Application source. By default it blocks until the sync operation completes; --prune deletes resources that no longer exist in Git. The exit code reflects success or failure.

Common usage

Terminal
argocd app sync guestbook --prune --timeout 300
# sync to a specific revision then wait for health
argocd app sync guestbook --revision "$GIT_SHA"
argocd app wait guestbook --health --timeout 300

Options

FlagWhat it does
--pruneDelete resources removed from Git
--revision <ref>Sync to a specific Git revision
--timeout <sec>Fail if the sync does not finish in time
--asyncReturn immediately without waiting
--forceUse kubectl replace/delete instead of apply
--resource <group:kind:name>Sync only selected resources

In CI

sync waits for the operation but not necessarily for resources to become Healthy; follow it with argocd app wait --health to gate on rollout. With auto-sync enabled, an explicit sync still helps in CI to make the deploy synchronous and fail the job on errors.

Common errors in CI

"FATA[0000] rpc error: code = FailedPrecondition desc = ... another operation is already in progress" means a sync is already running; wait or pass --retry-limit. "ComparisonError: rpc error ... Manifest generation error" points at bad manifests or a missing Helm/Kustomize binary. "one or more synchronization tasks completed unsuccessfully" with hook failures means a Job or hook resource errored.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →