This is documentation for the next version of Grafana documentation. For the latest stable release, go to the latest version.
Set up Git Sync as code
Caution
Git Sync is available in public preview for Grafana Cloud, and is an experimental feature in Grafana v12 for open source and Enterprise editions. Documentation and support is available based on the different tiers but might be limited to enablement, configuration, and some troubleshooting. No SLAs are provided.
Git Sync is under development. Refer to Usage and performance limitations for more information. Contact Grafana for support or to report any issues you encounter and help us improve this feature.
You can also configure Git Sync using grafanactl. Since Git Sync configuration is managed as code using Custom Resource Definitions (CRDs), you can create a Repository CRD in a YAML file and use grafanactl to push it to Grafana. This approach enables automated, GitOps-style workflows for managing Git Sync configuration instead of using the Grafana UI.
To set up Git Sync with grafanactl, follow these steps:
- Understand requirements, known issues, and limitations before you begin
- Create the repository CRD
- Push the repository CRD to Grafana
- Manage repository resources
- Verify setup
For more information, refer to the following documents:
Create the repository CRD
Create a repository.yaml file defining your Git Sync configuration:
apiVersion: provisioning.grafana.app/v0alpha1
kind: Repository
metadata:
name: <REPOSITORY_NAME>
spec:
title: <REPOSITORY_TITLE>
type: github
github:
url: <GITHUB_REPO_URL>
branch: <BRANCH>
path: grafana/
generateDashboardPreviews: true
sync:
enabled: true
intervalSeconds: 60
target: folder
workflows:
- write
- branch
secure:
token:
create: <GITHUB_PAT>Replace the placeholders with your values:
<REPOSITORY_NAME>: Unique identifier for this repository resource<REPOSITORY_TITLE>: Human-readable name displayed in Grafana UI<GITHUB_REPO_URL>: GitHub repository URL<BRANCH>: Branch to sync<GITHUB_PAT>: GitHub Personal Access Token
Note
Only
target: folderis currently supported for Git Sync.
Configuration parameters
The following configuration parameters are available:
Push the repository CRD to Grafana
Before pushing any resources, configure grafanactl with your Grafana instance details. Refer to the grafanactl configuration documentation for setup instructions.
Push the repository configuration:
grafanactl resources push --path <DIRECTORY>The --path parameter has to point to the directory containing your repository.yaml file.
After pushing, Grafana will:
- Create the repository resource
- Connect to your GitHub repository
- Pull dashboards from the specified path
- Begin syncing at the configured interval
Manage repository resources
List repositories
To list all repositories:
grafanactl resources get repositoriesGet repository details
To get details for a specific repository:
grafanactl resources get repository/<REPOSITORY_NAME>
grafanactl resources get repository/<REPOSITORY_NAME> -o json
grafanactl resources get repository/<REPOSITORY_NAME> -o yamlUpdate the repository
To update a repository:
grafanactl resources edit repository/<REPOSITORY_NAME>Delete the repository
To delete a repository:
grafanactl resources delete repository/<REPOSITORY_NAME>Verify setup
Check that Git Sync is working:
# List repositories
grafanactl resources get repositories
# Check Grafana UI
# Navigate to: Administration → Provisioning → Git Sync


