docs/sources/as-code/observability-as-code/git-sync/git-sync-setup/_index.md
{{< admonition type="caution" >}}
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 >}}
To set up Git Sync and synchronize your Grafana dashboards and folders with a GitHub repository, follow these steps:
To set up Git Sync from the Grafana UI, follow these steps:
Git Sync is available for any Git provider through a Pure Git repository type, and has specific enhanced integrations for GitHub, GitLab and Bitbucket. Refer to Compatible providers for more details.
Alternatively, on-prem file provisioning in Grafana lets you include resources, including folders and dashboard JSON files, that are stored in a local file system. Refer to Provision resources on-prem for more details.
Select any of the following options to proceed:
If you want to configure Git Sync for GitHub, you can connect using a Personal Access Token or with GitHub App.
If you want to configure Git Sync for GitHub and authenticate with a Personal Access Token, sign in to GitHub and create a new fine-grained personal access token with these permissions:
Refer to Managing your personal access tokens for instructions.
Return to Grafana and fill in the following fields:
Select Configure repository to set up your provisioning folder.
{{< admonition type="note" >}}
Refer to Create a GitHub App for instructions on how to create a GitHub App.
{{< /admonition >}}
If you want to configure Git Sync for GitHub and authenticate with GitHub App:
If you already have an existing GitHub App connected:
If you want to connect using a new GitHub App:
Note that your GitHub App must have the following permissions:
Select Configure repository to set up your provisioning folder.
If you want to configure Git Sync for GitLab, you need a GitLab Personal Access Token. To create one, sign in to GitLab and create a token with these permissions:
If you're using a token from a service account, you need to add the service account to the GitLab project as a member to avoid authentication issues.
After creating the token, return to Grafana and fill in the following fields:
Select Configure repository to set up your provisioning folder.
If you want to configure Git Sync for Bitbucket, you need a Bitbucket API token with scopes. To create one, sign in to Bitbucket and create an API token with these permissions:
Return to Grafana and fill in the following fields:
Select Configure repository to set up your provisioning folder.
If you're using another Git provider, you need to use the Pure Git option to configure your connection with a Personal Access Token:
Select Configure repository to set up your provisioning folder.
After configuring your connection authentication, continue to enter the details of the repository you want to use for provisioning:
main.Select Choose what to synchronize to have the connection to your repository verified and continue setup.
On this screen, you will sync the external resources you specified in the previous step with your Grafana instance. These provisioned resources will be stored in a new folder in Grafana without affecting the rest of your instance.
To set up synchronization:
{{< admonition type="note" >}}
Optionally, you can export any unmanaged resources into the provisioned folder. See how in Synchronize with external storage.
{{< /admonition >}}
Select Choose additional settings to continue setup.
In this screen:
After the process is completed, you will see a summary of the synced resources.
Click Choose additional settings for the final configuration steps.
In this last step, you can configure the Sync interval (seconds) to indicate how often you want your Grafana instance to pull updates from GitHub. The default value is 300 seconds in Grafana Cloud, and 60 seconds in Grafana OSS/Enterprise.
You can also select these optional settings:
Select Finish to complete the setup.
To verify that your dashboards are available at the location that you specified, go to Dashboards. The name of the dashboard is listed in the Name column.
Now that your dashboards have been synced from a repository, you can customize the name, change the branch, and create a pull request (PR) for it. Refer to Manage provisioned repositories with Git Sync for more information.
To update or delete your repository configuration after you've completed setup:
You've successfully set up Git Sync to manage your Grafana dashboards through version control. Your dashboards are now synchronized with a GitHub repository, enabling collaborative development and change tracking.
To learn more about using Git Sync refer to the following documents: