docs/sources/as-code/observability-as-code/git-sync/key-concepts.md
{{< admonition type="note" >}}
Git Sync is now GA for Grafana Cloud, OSS and Enterprise. Refer to Usage and performance limitations to understand usage limits for the different tiers.
Contact Grafana for support or to report any issues you encounter and help us improve this feature.
{{< /admonition >}}
Before you start using Git Sync, understand how the key Git Sync components relate:
A Grafana instance is a running Grafana server. Multiple instances can:
A Git repository is the external storage you want to sync your Grafana instance with. You can organize your Git repository in several ways:
dev/, prod/, or team-a/.main, develop, or team-a.Git Sync repositories support different combinations of repository URL, branch, and path:
repository: your-org/grafana-prod.repository: your-org/grafana-dev.repository: your-org/grafana-manifests, branch: main.repository: your-org/grafana-manifests, branch: develop.repository: your-org/grafana-manifests, branch: main, path: production/.repository: your-org/grafana-manifests, branch: main, path: development/.A repository resource is a Grafana configuration object that defines the connection between a group of repositories and your Grafana instance via Git Sync.
Each repository resource creates bidirectional synchronization between a Grafana instance and a specific location in Git.
A connection is the authentication setup between Grafana and an external Git provider, required when you're not using a Personal Access Token or a static token to authenticate. Use it to authorize access to your external repositories, and to generate or refresh the credentials for Git Sync. A single connection can be reused across multiple repositories.
For example, if you're using GitHub App to authenticate, the connection represents the app installation. Grafana uses this connection to authenticate with GitHub, create access tokens, and authorize repository access on your behalf.
The connection resource includes:
Git Sync is bidirectional, and syncs a repository resource with your Grafana instance. You can modify provisioned resources both from the Grafana UI or from the synced GitHub repository, and changes will be reflected in both places:
You can find the provisioned dashboards organized in folders under Dashboards.
With Git Sync you can place synced resources in Grafana in two ways:
Use folder sync to keep each repository's resources grouped together under a dedicated folder. Use folderless sync when you want provisioned resources to appear at the top of your Dashboards view instead of nested inside a repository folder.
Both modes can coexist with each other and with resources that aren't managed by Git Sync.
The following examples use the same repository to show how the same files appear with each mode.
The repository grafana-manifests syncs from the path grafana/:
your-org/grafana-manifests/
└── grafana/
├── cpu-metrics.json
└── team-platform/
├── .folder.json
└── memory-usage.json
The instance also has content that isn't managed by Git Sync: a manually created Ops folder and an Ad-hoc dashboard.
With folder sync, a repository folder wraps the synced resources, alongside the unprovisioned content:
Dashboards
├── 📁 grafana-manifests/ ← managed by Git Sync
│ ├── CPU Metrics Dashboard
│ └── 📁 team-platform/
│ └── Memory Usage Dashboard
├── 📁 Ops/ ← not managed by Git Sync
│ └── Ops dashboard
└── Ad-hoc dashboard ← not managed by Git Sync
With folderless sync, the same files map to the top level, next to the unprovisioned content:
Dashboards
├── CPU Metrics Dashboard ← managed by Git Sync
├── 📁 team-platform/ ← managed by Git Sync
│ └── Memory Usage Dashboard
├── 📁 Ops/ ← not managed by Git Sync
│ └── Ops dashboard
└── Ad-hoc dashboard ← not managed by Git Sync
Folderless sync only manages the resources it provisions. The unprovisioned Ops folder and Ad-hoc dashboard are left untouched.
Because folderless sync doesn't create a wrapper folder, several folderless repositories can sync to the top level at the same time. Each repository manages only the resources it provisions:
Dashboards
├── CPU Metrics Dashboard ← managed by grafana-manifests
├── 📁 team-platform/ ← managed by grafana-manifests
│ └── Memory Usage Dashboard
├── Billing Overview ← managed by finance-dashboards
├── 📁 invoices/ ← managed by finance-dashboards
│ └── Monthly Invoices
└── Ad-hoc dashboard ← not managed by Git Sync
Your Grafana instance can be in one of the following Git Sync states:
Here's an example showing how the repository, branch, and path concepts work together:
Configuration:
your-org/grafana-manifestsmainteam-platform/grafana/In Git (on branch main):
your-org/grafana-manifests/
├── .git/
├── README.md
├── team-platform/
│ └── grafana/
│ ├── cpu-metrics.json ← Synced
│ ├── memory-usage.json ← Synced
│ └── disk-io.json ← Synced
├── team-data/
│ └── grafana/
│ └── pipeline-stats.json ← Not synced (different path)
└── other-files.txt ← Not synced (outside path)
In the Grafana Dashboards view:
Dashboards
└── 📁 grafana-manifests/
├── CPU Metrics Dashboard
├── Memory Usage Dashboard
└── Disk I/O Dashboard
Key takeaways:
team-platform/grafana/).