---
title: Connect your Git provider to Databricks
description: Learn how to configure Git credentials and connect Databricks to a Git provider.
canonical_url: https://docs.databricks.com/aws/en/repos/get-access-tokens-from-git-provider
---

# Connect your Git provider to Databricks

This page explains how to configure a user's Git credentials in Databricks so you can connect remote repositories using Git folders. Choose your Git provider below and follow the authentication steps.

* [GitHub](https://docs.databricks.com/aws/en/repos/get-access-tokens-from-git-provider.md#github)
* [GitLab](https://docs.databricks.com/aws/en/repos/get-access-tokens-from-git-provider.md#gitlab)
* [AWS CodeCommit](https://docs.databricks.com/aws/en/repos/get-access-tokens-from-git-provider.md#aws-codecommit)
* [Azure DevOps Services](https://docs.databricks.com/aws/en/repos/get-access-tokens-from-git-provider.md#azure-devops-services)
* [Bitbucket](https://docs.databricks.com/aws/en/repos/get-access-tokens-from-git-provider.md#bitbucket)
* [Other Git providers](https://docs.databricks.com/aws/en/repos/get-access-tokens-from-git-provider.md#other-git-providers)

> [!NOTE]
>
> You can also configure Git credentials for a Databricks service principal. Service principals are the recommended Git credential for jobs and automated pipelines that shouldn't be associated with a user.
>
> To authorize a Databricks service principal to access your workspace's Git folders, see [Authorize a service principal to access Git folders](https://docs.databricks.com/aws/en/repos/automate-with-sp.md).

## <a id="github-and-github-ae" />GitHub

This section covers GitHub and GitHub Advanced Enterprise.

### <a id="github-link-account" />Databricks GitHub app (recommended)

For hosted GitHub accounts, Databricks recommends using the [Databricks GitHub app](https://github.com/apps/databricks) for authentication instead of personal access tokens (PATs). The GitHub app uses OAuth 2.0 with encrypted repository traffic, renews tokens automatically, and lets you scope access to specific repositories.

> [!NOTE]
>
> * GitHub Enterprise Server doesn't support linking your GitHub account. Use a [personal access token](https://docs.databricks.com/aws/en/repos/get-access-tokens-from-git-provider.md#github-personal-access-token) instead.
> * [Enterprise Managed Users](https://docs.github.com/en/enterprise-cloud@latest/apps/using-github-apps/installing-your-own-github-app) can use the Databricks GitHub app with organization repositories, but not with personal repositories. Enterprise Managed Users can't install GitHub Apps on their user accounts, so to work with a personal repository, use a [personal access token](https://docs.databricks.com/aws/en/repos/get-access-tokens-from-git-provider.md#github-personal-access-token) instead.

To link your GitHub account with the Databricks GitHub app:

1. Click your user icon and select **Settings**.

2. Click the **Linked accounts** tab.

3. Click **Add Git credential**.

4. Set your provider to **GitHub**, select **Link Git account**, and click **Link**.

   ![Link GitHub account in Databricks](https://docs.databricks.com/aws/en/images/repos/link-github-account-in-databricks.png)

5. On the Databricks GitHub app authorization page, click **Authorize Databricks** to authorize the app. This allows Databricks to perform Git operations on your behalf, such as cloning repositories. See [Authorizing GitHub Apps](https://docs.github.com/en/apps/using-github-apps/authorizing-github-apps) in the GitHub documentation.

6. Install the Databricks GitHub app on repositories that you want to access from Git folders:

   1. Open the [Databricks GitHub app installation page](https://github.com/apps/databricks/installations/new). To install the app, you must be an organization owner, or a repository admin for the repositories you want to access. On a personal account, you must be the account owner.
   2. Select the account that owns the repositories you want to access.
   3. Optionally, choose **Only select repositories** to limit access to specific repositories.
   4. Click **Install**.

   For more information, see [About installing GitHub Apps](https://docs.github.com/en/apps/using-github-apps/installing-a-github-app-from-github-marketplace-for-your-organizations#about-installing-github-apps).

Databricks stores your access and refresh tokens following standard OAuth 2.0 integration. GitHub manages all other access control. Access tokens expire after 8 hours. Refresh tokens expire after 6 months of inactivity, requiring you to reconfigure your credentials. You can optionally encrypt tokens using [customer-managed keys](https://docs.databricks.com/aws/en/security/keys/customer-managed-keys.md).

### <a id="github-personal-access-token" />Classic personal access token

To create a classic personal access token in GitHub:

1. Click your user icon, then click **Settings**.
2. Click **Developer settings**.
3. Click **Personal access tokens** > **Tokens (classic)**.
4. Click **Generate new token (classic)**.
5. Enter a note to indicate the purpose of the token.
6. Select the **repo** scope. If your repository uses GitHub Action workflows, also select the **workflow** scope.
7. Click **Generate token**.
8. Copy the token and enter it in Databricks under **Settings** > **Linked accounts**.

For single sign-on, see [Authorizing a personal access token for use with single sign-on](https://docs.github.com/en/enterprise-cloud@latest/authentication/authenticating-with-saml-single-sign-on/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on).

### <a id="github-personal-access-token-fg" />Fine-grained personal access token

Fine-grained PATs grant access only to the specific resources you need. To create one in GitHub:

1. Click your user icon, then click **Settings**.

2. Click **Developer settings**.

3. Click **Personal access tokens** > **Fine-grained tokens**.

4. Click **Generate new token**.

5. Configure the token:
   * **Token name**: Enter a unique, memorable name.
   * **Description**: Describe the token's purpose.
   * **Resource owner**: Select the GitHub organization that owns the repositories you'll access.
   * **Expiration**: Choose an expiration period (default is 30 days).
   * **Repository access**: Select only the repositories needed for Git folder version control.
   * **Permissions**: Click **Add permissions** and set **Contents** to **Read and write**. To let Databricks features open pull requests for you, also set **Pull requests** to **Read and write**. See [GitHub's documentation on the Contents scope](https://docs.github.com/en/rest/authentication/permissions-required-for-fine-grained-personal-access-tokens?apiVersion=2022-11-28#repository-permissions-for-contents) and [Permissions required for fine-grained personal access tokens](https://docs.github.com/en/rest/authentication/permissions-required-for-fine-grained-personal-access-tokens).

6. Click **Generate token**.

7. Copy the token and enter it in Databricks under **Settings** > **Linked accounts**.

## <a id="gitlab" />GitLab

These instructions apply to both GitLab.com and GitLab Self-Managed (formerly GitLab Enterprise Edition).

To create a personal access token in GitLab:

1. Click your user icon and select **Preferences**.
2. Click **Personal access tokens** in the sidebar.
3. Click **Add new token**.
4. Enter a name for the token.
5. Select the scopes for your desired permission levels. See [Personal access token scopes](https://gitlab.com/help/user/profile/personal_access_tokens#personal-access-token-scopes) in the GitLab documentation.
6. Click **Create token**.
7. Copy the token and enter it in Databricks under **Settings** > **Linked accounts**.

For fine-grained access to a specific project, use [project access tokens](https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html).

## <a id="codecommit" />AWS CodeCommit

To create HTTPS Git credentials in AWS CodeCommit:

1. Create HTTPS Git credentials following the [AWS CodeCommit documentation](https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html). The associated IAM user must have read and write permissions for the repository.
2. Copy the password and enter it in Databricks under **Settings** > **Linked accounts**.

## <a id="devops" />Azure DevOps Services

### <a id="diff-tenancy" />Personal access token

Use a personal access token when your Databricks and Azure DevOps repositories aren't in the same Microsoft Entra ID tenancy.

The Microsoft Entra ID service endpoint must be accessible from both the private and public subnets of the Databricks workspace. For more information, see [VPC peering](https://docs.databricks.com/aws/en/security/network/classic/vpc-peering.md).

To create a personal access token in Azure DevOps:

1. Go to dev.azure.com and sign in to the DevOps organization containing your repository.
2. Click the user settings icon and select **Personal Access Tokens**.
3. Click **+ New Token**.
4. Configure the token:
   * Enter a name for the token.
   * Select the organization (repository name).
   * Set an expiration date.
   * Choose the required scope, such as **Full access**.
5. Copy the access token.
6. In Databricks, go to **Settings** > **Linked accounts** and enter the token.
7. In **Git provider username or email**, enter the email address you use to sign in to the DevOps organization.

For more information about Azure DevOps personal access tokens, see the [Azure DevOps documentation](https://learn.microsoft.com/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops\&tabs=Windows).

## <a id="bitbucket" />Bitbucket

Databricks supports both Bitbucket Cloud and Bitbucket Data Center (formerly Bitbucket Server).

For Bitbucket Cloud, Databricks supports authentication using API tokens and access tokens. Databricks recommends using API tokens for users and access tokens for service principals.

For Bitbucket Data Center, use a personal access token with repository read and write permissions. See the [Bitbucket Data Center documentation](https://confluence.atlassian.com/bitbucketserver/personal-access-tokens-939515499.html).

### <a id="bitbucket-api-token" />API token (recommended)

To generate a scoped Bitbucket API token, follow the [Bitbucket documentation](https://support.atlassian.com/bitbucket-cloud/docs/create-an-api-token/).

The token must have `read:repository:bitbucket` and `write:repository:bitbucket` scopes. To let Databricks features open pull requests for you, Databricks recommends also adding `read:pullrequest:bitbucket` and `write:pullrequest:bitbucket`.

![Select Bitbucket API scopes](https://docs.databricks.com/aws/en/images/repos/select_bitbucket_scopes.png)

Add the token in Databricks under **Settings** > **Linked accounts**.

### <a id="bitbucket-access-token" />Access token

Bitbucket access tokens provide scoped authentication to repositories, projects, or workspaces. They're designed for CI/CD and are recommended for service principals. To create an access token, see the [Bitbucket documentation on access tokens](https://support.atlassian.com/bitbucket-cloud/docs/access-tokens/).

To configure access tokens for a Databricks service principal, see [Authorize a service principal to access Git folders](https://docs.databricks.com/aws/en/repos/automate-with-sp.md).

### <a id="bitbucket-app-password" />App password

> [!NOTE]
>
> Atlassian deprecated app passwords for Bitbucket on June 9, 2026, and app passwords no longer work. Databricks recommends migrating to API tokens, which provide enhanced security and admin control. For more information, see [Bitbucket Cloud transitions to API tokens](https://www.atlassian.com/blog/bitbucket/bitbucket-cloud-transitions-to-api-tokens-enhancing-security-with-app-password-deprecation).

## Other Git providers

If your Git provider isn't listed, try selecting **GitHub** and entering the PAT from your provider. This approach often works but isn't guaranteed.
