Skip to main content
The argocd repo command manages repository connections, allowing Argo CD to access Git repositories, Helm charts, and OCI registries.

Quick Examples

# Add a Git repository
argocd repo add [email protected]:repos/repo

# Get repository details
argocd repo get https://github.com/yourusername/your-repo.git

# List all repositories
argocd repo list

# Remove a repository
argocd repo rm https://github.com/yourusername/your-repo.git

Subcommands

add

Add Git, Helm, or OCI repository connection parameters.
Add a private Git repository using SSH:
# With SSH key
argocd repo add [email protected]:myorg/myrepo.git \
  --ssh-private-key-path ~/.ssh/id_rsa

# Ignore host key checking (not recommended for production)
argocd repo add [email protected]:repos/repo \
  --insecure-ignore-host-key \
  --ssh-private-key-path ~/id_rsa

# Non-standard SSH port
argocd repo add ssh://[email protected]:2222/repos/repo \
  --ssh-private-key-path ~/id_rsa
Key Flags:
--type
string
default:"git"
Repository type: git, helm, or oci
--name
string
Repository name (required for Helm repositories)
--username
string
Username for authentication
--password
string
Password for authentication
--ssh-private-key-path
string
Path to SSH private key file
--tls-client-cert-path
string
Path to TLS client certificate (PEM format)
--tls-client-cert-key-path
string
Path to TLS client certificate key (PEM format)
--insecure-skip-server-verification
boolean
Disable server certificate and host key checks
--upsert
boolean
Update repository if it already exists
--project
string
Restrict repository to specific project

Advanced Authentication Options

GitHub App

Authenticate using GitHub App:
# GitHub.com
argocd repo add https://github.com/myorg/myrepo.git \
  --github-app-id 12345 \
  --github-app-installation-id 67890 \
  --github-app-private-key-path app-private-key.pem

# GitHub Enterprise
argocd repo add https://ghe.example.com/myorg/myrepo.git \
  --github-app-id 12345 \
  --github-app-installation-id 67890 \
  --github-app-private-key-path app-private-key.pem \
  --github-app-enterprise-base-url https://ghe.example.com/api/v3
--github-app-id
integer
GitHub Application ID
--github-app-installation-id
integer
GitHub App installation ID (optional, auto-discovered if not provided)
--github-app-private-key-path
string
Path to GitHub App private key file
--github-app-enterprise-base-url
string
Base URL for GitHub Enterprise API

Google Cloud Source

Authenticate with GCP service account:
argocd repo add https://source.developers.google.com/p/my-project/r/my-repo \
  --gcp-service-account-key-path service-account-key.json

Proxy Configuration

Add repository with proxy support:
# With SOCKS5 proxy (no auth)
argocd repo add ssh://[email protected]/argoproj/argocd-example-apps \
  --ssh-private-key-path ~/id_rsa \
  --proxy socks5://proxy.example.com:1080

# With SOCKS5 proxy (with auth)
argocd repo add ssh://[email protected]/argoproj/argocd-example-apps \
  --ssh-private-key-path ~/id_rsa \
  --proxy socks5://username:[email protected]:1080

Git LFS

Enable Git Large File Storage:
argocd repo add https://github.com/myorg/large-files-repo.git \
  --username git \
  --password token \
  --enable-lfs

list

List all configured repositories.
# List repositories
argocd repo list

# List with refresh status
argocd repo list --refresh

# List as JSON
argocd repo list -o json

# List as YAML
argocd repo list -o yaml
Output:
TYPE  NAME                REPO                                          INSECURE  OCI    LFS    CREDS  STATUS      MESSAGE  PROJECT
git                       https://github.com/argoproj/argocd-example-apps.git  false     false  false  false  Successful           default
git                       [email protected]:myorg/private-repo.git                 false     false  false  true   Successful           default
helm  stable              https://charts.helm.sh/stable                         false     false  false  false  Successful           default
helm  my-charts           https://charts.example.com                            false     false  false  true   Successful           my-project
oci   oci-registry        oci://registry.example.com                            false     true   false  true   Successful           default

get

Get details about a configured repository.
# Get repository by URL
argocd repo get https://github.com/myorg/myrepo.git

# Get with output format
argocd repo get https://github.com/myorg/myrepo.git -o yaml

# Refresh connection status
argocd repo get https://github.com/myorg/myrepo.git --refresh
Output:
Repository:
  URL:                  https://github.com/argoproj/argocd-example-apps.git
  Type:                 git
  Connection Status:    Successful
  Message:              
Info:
  Last Checked:         2024-01-15 14:30:45 +0000 UTC
  Connection State:     Successful

rm

Remove a repository configuration.
# Remove repository
argocd repo rm https://github.com/myorg/myrepo.git

# Remove without confirmation
argocd repo rm https://github.com/myorg/myrepo.git --yes
Removing a repository does not delete applications using it, but they will no longer be able to sync.

Repository Credentials (repocreds)

For managing credential templates that apply to multiple repositories, use argocd repocreds:

Add Credential Template

# Git credentials for all repos under a URL
argocd repocreds add https://github.com/myorg \
  --username git \
  --password ghp_xxxxxxxxxxxx

# SSH credentials
argocd repocreds add [email protected]:myorg \
  --ssh-private-key-path ~/.ssh/id_rsa

# TLS credentials
argocd repocreds add https://git.example.com \
  --tls-client-cert-path ~/cert.pem \
  --tls-client-cert-key-path ~/key.pem

List Credential Templates

# List all credential templates
argocd repocreds list

# List as JSON
argocd repocreds list -o json

Remove Credential Template

argocd repocreds rm https://github.com/myorg

Common Workflows

Adding GitHub Private Repository

# Using Personal Access Token
argocd repo add https://github.com/myorg/private-repo.git \
  --username git \
  --password ghp_YourPersonalAccessTokenHere

# Using SSH
argocd repo add [email protected]:myorg/private-repo.git \
  --ssh-private-key-path ~/.ssh/github_deploy_key

# Using GitHub App (recommended for organizations)
argocd repo add https://github.com/myorg/private-repo.git \
  --github-app-id 123456 \
  --github-app-installation-id 789012 \
  --github-app-private-key-path github-app.pem

Adding GitLab Private Repository

# Using Deploy Token
argocd repo add https://gitlab.com/myorg/myrepo.git \
  --username gitlab-deploy-token \
  --password gldt-xxxxxxxxxxxx

# Using SSH
argocd repo add [email protected]:myorg/myrepo.git \
  --ssh-private-key-path ~/.ssh/gitlab_deploy_key

Adding Azure DevOps Repository

# Using Personal Access Token
argocd repo add https://dev.azure.com/myorg/myproject/_git/myrepo \
  --username anystring \
  --password your-pat-token

Adding Bitbucket Repository

# Using App Password
argocd repo add https://bitbucket.org/myorg/myrepo.git \
  --username myusername \
  --password app-password

# Using SSH
argocd repo add [email protected]:myorg/myrepo.git \
  --ssh-private-key-path ~/.ssh/bitbucket_key

Managing Multiple Repositories

Use credential templates for efficiency:
# Add credential template for organization
argocd repocreds add https://github.com/myorg \
  --username git \
  --password ghp_xxxxxxxxxxxx

# Now add repositories without specifying credentials
argocd repo add https://github.com/myorg/repo1.git
argocd repo add https://github.com/myorg/repo2.git
argocd repo add https://github.com/myorg/repo3.git

Helm Chart Repositories

# Popular public Helm repos
argocd repo add https://charts.bitnami.com/bitnami --type helm --name bitnami
argocd repo add https://kubernetes.github.io/ingress-nginx --type helm --name ingress-nginx
argocd repo add https://prometheus-community.github.io/helm-charts --type helm --name prometheus

# Private Helm repo with basic auth
argocd repo add https://charts.mycompany.com \
  --type helm \
  --name company-charts \
  --username admin \
  --password secret123

OCI Registries

# Docker Hub
argocd repo add oci://registry.hub.docker.com \
  --type oci \
  --name dockerhub \
  --username myusername \
  --password mydockerhubtoken

# AWS ECR
argocd repo add oci://123456789.dkr.ecr.us-west-2.amazonaws.com \
  --type oci \
  --name ecr \
  --username AWS \
  --password $(aws ecr get-login-password --region us-west-2)

# Google Artifact Registry
argocd repo add oci://us-docker.pkg.dev/my-project/my-repo \
  --type oci \
  --name gar \
  --username _json_key \
  --password "$(cat service-account-key.json)"

Troubleshooting

Test Repository Connection

# Check repository status
argocd repo get https://github.com/myorg/myrepo.git

# Force refresh connection
argocd repo get https://github.com/myorg/myrepo.git --refresh

# List all repos with status
argocd repo list --refresh

Authentication Failures

# For HTTPS: verify credentials
curl -u username:password https://github.com/myorg/myrepo.git/info/refs?service=git-upload-pack

# For SSH: test SSH connection
ssh -T [email protected] -i ~/.ssh/deploy_key

# Update credentials
argocd repo add https://github.com/myorg/myrepo.git \
  --username git \
  --password new-token \
  --upsert

Certificate Issues

# Temporarily skip verification (not for production)
argocd repo add https://git.example.com/repo.git \
  --username git \
  --password token \
  --insecure-skip-server-verification

# Or add proper certificates
argocd repo add https://git.example.com/repo.git \
  --username git \
  --password token \
  --tls-client-cert-path /path/to/cert.pem \
  --tls-client-cert-key-path /path/to/key.pem

SSH Key Issues

# Verify SSH key permissions
chmod 600 ~/.ssh/deploy_key

# Test SSH connection
ssh -i ~/.ssh/deploy_key [email protected]

# Add with correct key
argocd repo add [email protected]:myorg/myrepo.git \
  --ssh-private-key-path ~/.ssh/deploy_key

Security Best Practices

  • Use deploy keys or tokens with minimal required permissions
  • For GitHub, use GitHub Apps instead of personal access tokens
  • Rotate credentials regularly
  • Use credential templates (repocreds) to avoid duplicating secrets
  • Never commit credentials to Git repositories
  • Use secrets management systems (Vault, etc.) where possible
  • Enable Git LFS only when needed to avoid performance issues
  • Use TLS certificates for private Git servers

Environment Variables

Repository credentials can also be configured via environment variables:
export ARGOCD_REPO_URL="https://github.com/myorg/myrepo.git"
export ARGOCD_REPO_USERNAME="git"
export ARGOCD_REPO_PASSWORD="ghp_token"

argocd repo add $ARGOCD_REPO_URL --username $ARGOCD_REPO_USERNAME --password $ARGOCD_REPO_PASSWORD

Next Steps

App Commands

Create applications from repositories

Project Commands

Organize repositories by project

Build docs developers (and LLMs) love