Git Tracking Strategies
Argo CD supports multiple ways to track your Git repository, each suited for different use cases.HEAD / Branch Tracking
Track the tip of a branch for continuous deployment:- Development environments
- Continuous deployment pipelines
- Automatic updates on every commit
With auto-sync enabled, every push to the tracked branch automatically deploys to your cluster.
Tag Tracking
Track a specific Git tag for more stable deployments:- Staging environments
- Release-based deployments
- Controlled updates
targetRevision.
If you retag the same tag name to a different commit, Argo CD will detect the change and sync accordingly.
Semantic Version Ranges
Automatically track the latest version within a range:
Examples:
Commit SHA Pinning
Pin to a specific commit for maximum control:- Production environments
- Strict change control
- Compliance requirements
targetRevision to a different commit SHA.
Parameter overrides still apply even with commit pinning.
Handling Ambiguous Git References
When a branch and tag share the same name, use fully-qualified references: Problem scenario:targetRevision: release-1.0, Argo CD may resolve to either commit, causing reconciliation loops.
Solution: Use fully-qualified references:
Helm Chart Tracking
Helm charts use semantic versioning:Resource Tracking Methods
Argo CD tracks deployed resources using labels or annotations.Annotation-Based Tracking (Default)
Uses theargocd.argoproj.io/tracking-id annotation:
- No conflicts with other tools
- No 63-character truncation limit
- Clear ownership per Argo CD instance
argocd-cm:
Annotation + Label Tracking
Uses annotation for tracking, adds label for compatibility:The label is informational only and truncated if longer than 63 characters. Tracking uses the annotation.
Label-Based Tracking (Legacy)
Uses theapp.kubernetes.io/instance label:
- 63-character label limit
- Potential conflicts with other tools
- Difficult to run multiple Argo CD instances
Custom Label
Use a custom label instead of the default:Installation ID
Run multiple Argo CD instances on the same cluster:- Each resource gets:
argocd.argoproj.io/installation-id: production-argocd - Prevents conflicts between instances
- Allows multiple apps with the same name
Non-Self-Referencing Annotations
When using annotation-based tracking, resources can be copied to other namespaces without affecting sync status:other:
Tracking Strategy Examples
Development Environment
Staging Environment
Production Environment
Helm Chart with Version Range
Automatic Sync Behavior
With auto-sync enabled:- New commit to tracked branch
- Tag update (if tracking a tag)
- New version matching semantic range
- Manual changes in cluster (if
selfHeal: true)
- Only syncs when OutOfSync
- Won’t retry if previous sync to same commit failed
- Retries after self-heal timeout (5s default) if
selfHeal: true
Parameter overrides always take precedence over Git state.
Changing Tracking Methods
To switch tracking methods:-
Update
argocd-cmConfigMap: -
Sync all applications to apply new tracking method:
- Argo CD will add the new tracking identifier to resources
You can safely revert to a previous tracking method by updating the ConfigMap and re-syncing.
Best Practices
Match Strategy to Environment
Use HEAD for dev, ranges for staging, pins for production
Use Annotation Tracking
Avoid label conflicts and truncation issues
Avoid Ambiguous References
Don’t use same name for branches and tags
Semantic Versioning
Use semver tags for predictable version tracking
Troubleshooting
Application Not Detecting Changes
-
Verify target revision:
-
Check if tracking a branch:
-
Force refresh:
Resources Not Tracked
-
Check tracking annotation:
-
Verify tracking method in ConfigMap:
-
Re-sync application to apply tracking:
Version Range Not Working
-
Verify tags exist:
-
Check if tags are semver:
-
Include prereleases if needed:
Next Steps
Sync Options
Configure how applications sync
Sync Waves
Control deployment order
Creating Apps
Learn how to create applications
Health Checks
Monitor application health