argocd repo add: Register a Git Repository
argocd repo add registers a Git repository and its credentials so Applications can source manifests from it.
Private repos must be added with credentials before any Application can use them. The CLI supports HTTPS token auth and SSH keys.
What it does
argocd repo add stores a repository URL plus credentials in Argo CD. For HTTPS, pass --username and --password (a PAT). For SSH, pass --ssh-private-key-path. The credential is reused by any Application whose --repo matches.
Common usage
# HTTPS with a personal access token
argocd repo add https://github.com/acme/manifests.git \
--username git --password "$GITHUB_TOKEN"
# SSH
argocd repo add git@github.com:acme/manifests.git \
--ssh-private-key-path ./deploy_keyOptions
| Flag | What it does |
|---|---|
| --username / --password | HTTPS credentials (use a token as password) |
| --ssh-private-key-path <file> | SSH key for git@ URLs |
| --insecure-skip-server-verification | Skip SSH host key verification |
| --type git|helm | Repository type (git default; helm for chart repos) |
| --name <name> | Friendly name (required for some helm repos) |
Common errors in CI
"FATA[0000] rpc error: code = Unknown desc = authentication required" means missing or wrong credentials for a private repo. "ssh: handshake failed: knownhosts: key is unknown" means the host key is not trusted; add it to the repo-server known hosts or pass --insecure-skip-server-verification for tests. The repo URL in repo add must match the Application --repo exactly, including the .git suffix.