docs/sources/as-code/observability-as-code/git-sync/git-sync-setup/set-up-before.md
Before you begin to set up Git Sync, ensure you have the following:
The provisioning feature toggle is enabled by default in Grafana Cloud and, starting in Grafana v13, for OSS and Enterprise as well. No manual configuration is required.
For more information about feature toggles, refer to Configure feature toggles.
If you're using Grafana Enterprise v12.4.0 and want to set up Git Sync with pure Git, GitLab or Bitbucket, or if you're using Grafana OSS v12.4.0 and want to set up Git Sync with pure Git, add them to your configuration file:
Open your Grafana configuration file, either grafana.ini or custom.ini.
Add the available providers:
[provisioning]
repository_types = "git|github|bitbucket|gitlab|local"
Save the changes to the file and restart Grafana.
Git Sync requires network connectivity between your Grafana instance and Git server. Understanding the traffic patterns helps you configure firewall rules and allowlists correctly.
Git Sync uses two types of network traffic:
*.grafana.netGit Sync does not route over AWS PrivateLink or Private Data Source Connect (PDC).
AWS PrivateLink and PDC provide a separate tunnel for data source query traffic (Grafana → your private databases or data sources). Git Sync uses the normal public path from the Hosted Grafana IPs and is independent of PrivateLink/PDC.
If you use AWS PrivateLink or PDC for data sources, you can still use Git Sync. The two features neither interfere with nor depend on each other.
Finally, get acquainted with the following topics:
{{< admonition type="note" >}} This setting is available for Grafana v13.0.4 and Grafana v13.1.1 and later. It only applies to self-managed Grafana (OSS and Enterprise), but it's not configurable in Grafana Cloud. {{< /admonition >}}
While public Git servers such as github.com, gitlab.com, and bitbucket.org resolve to public addresses and are always allowed, by default Git Sync rejects repository URLs with a host that resolves to a loopback, a private (RFC 1918), link-local, or an unspecified address. This protects your Grafana instance against server-side request forgery (SSRF).
If you connect Git Sync to a Git server on a private network such as a self-hosted GitHub Enterprise, GitLab, or Bitbucket instance reachable only through an internal address, add its host to the allowed_git_urls allowlist:
Open your Grafana configuration file, either grafana.ini or custom.ini.
Add each internal Git host to allowed_git_urls as a comma-separated list:
[provisioning]
allowed_git_urls = git.internal.example.com, ghe.example.com:8443
Save the changes to the file and restart Grafana.
Each entry can be a hostname, host:port, a full URL (only the host is used), a literal IP address, or a CIDR range. If possible, use specific hosts or narrow ranges, since a broad CIDR such as 10.0.0.0/8 re-exposes the entire private range that SSRF protection blocks.
Only add hosts you trust because an allowlisted host receives the configured Git token on every sync, fetch, and push.
By default, folders provisioned with Git Sync have these roles:
Refer to Git Sync permissions for details on how to set up permissions in Git Sync. To modify them, refer to Manage folder permissions.
Refer to Roles and permissions for more information about Grafana roles.
GitHub Apps are tools that extend GitHub functionality. They use fine-grained permissions and short-lived tokens, giving you more control over which repositories are being accessed. Find out more in the GitHub Apps official documentation.
If you chose to authenticate with a newly created GitHub App, you'll need the following parameters:
There are many ways to create a GitHub App. The following instructions are informative only, always refer to official GitHub documentation for more details.
To create the GitHub App, follow these steps:
On the app page:
Finally, install the app:
installationID from the page URL https://github.com/settings/installations/installationIDYou can now proceed to Set up Git Sync!