Course contentsShow
← Cloud and Infrastructure
Lesson 1882 of 2,98940. ArgoCDFree lesson

Connecting Git Repositories

Register Git repositories in ArgoCD for tracking Kubernetes manifests.

Connecting Git Repositories

You'll learn how to register Git repositories in ArgoCD so it can track and sync your Kubernetes manifests.

What This Means

Before ArgoCD can deploy anything, it needs to know where your Kubernetes manifests live. Think of it like giving ArgoCD a library card—it needs access credentials and the address (URL) of your Git repository to read the "books" (YAML files) inside.

Connecting a repository tells ArgoCD: "Watch this Git repo; it contains the desired state of my applications."

How Repository Connections Work

ArgoCD stores repository credentials securely and uses them to pull manifest files during sync operations. You can connect repositories via the UI, CLI, or declaratively using Kubernetes secrets.

Via CLI

argocd repo add https://github.com/yourorg/yourrepo.git \
  --username your-username \
  --password your-token

Via UI

Navigate to Settings → Repositories → Connect Repo, then provide:

  • Repository URL
  • Authentication method (HTTPS, SSH, GitHub App)
  • Credentials (username/password, SSH key, or token)

SSH Key Authentication

For SSH-based repos:

argocd repo add git@github.com:yourorg/yourrepo.git \
  --ssh-private-key-path ~/.ssh/id_rsa

Why This Matters

Without connecting your repository, ArgoCD cannot perform its pull-based reconciliation. It's the foundational step that enables GitOps: giving your CD tool read access to the single source of truth.

Key Takeaway: Connecting Git repositories in ArgoCD registers your manifest sources with proper authentication, enabling ArgoCD to continuously monitor and sync your desired Kubernetes state from Git.