Bitbucket Cloud and Bitbucket Server version control

This guide describes how to set up version control for notebooks using Bitbucket Cloud and Bitbucket Server through the UI.


Databricks recommends that you use Git integration with Databricks Repos to sync your work in Databricks with a remote Git repository.

Bitbucket Server support

Databricks Repos supports Bitbucket Server integration, if the server is internet accessible.

To integrate with a Bitbucket Server instance that is not internet-accessible, get in touch with your Databricks representative.

Enable and disable Git versioning

By default version control is enabled. To toggle this setting, see Manage the ability to version notebooks in Git. If Git versioning is disabled, the Git Integration tab is not visible in the User Settings screen.

Configure version control

Configuring version control involves creating access credentials in your version control provider and adding those credentials to Databricks.

Get an app password

  1. Go to Bitbucket Cloud and create an app password that allows access to your repositories. See the Bitbucket Cloud documentation.

  2. Record the password. You enter this password in Databricks in the next step.

Save your app password and username to Databricks

  1. Click User Settings Icon Settings at the lower left of your screen and select User Settings.

  2. Click the Git Integration tab.

  3. If you have previously entered credentials, click the Change settings button.

  4. In the Git provider drop-down, select Bitbucket Cloud.

  5. Paste your app password into the App password field.

  6. Enter your username into the Git provider username field and click Save.

You can also save your app password and username to Databricks by using the Databricks Terraform provider and databricks_git_credential.

Work with notebook revisions

You work with notebook revisions in the History panel. Open the history panel by clicking Revision history at the top right of the notebook.

Revision history


You cannot modify a notebook while the History panel is open.

Save a notebook to Bitbucket Cloud

While the changes that you make to your notebook are saved automatically to the Databricks revision history, changes do not automatically persist to Bitbucket Cloud.

  1. Open the History panel.

    History panel - save now
  2. Click Save Now to save your notebook to Bitbucket Cloud. The Save Notebook Revision dialog appears.

  3. Optionally, enter a message to describe your change.

  4. Make sure that Also commit to Git is selected.

    Save revision
  5. Click Save.

Revert or update a notebook to a version from Bitbucket Cloud

Once you link a notebook, Databricks syncs your history with Git every time you re-open the History panel. Versions that sync to Git have commit hashes as part of the entry.

  1. Open the History panel.

    History panel
  2. Choose an entry in the History panel. Databricks displays that version.

  3. Click Restore this version.

  4. Click Confirm to confirm that you want to restore that version.

Create a pull request

  1. Open History panel.

  2. Click the Git status bar to open the Git Preferences dialog.

    Git preferences - create pull request
  3. Click Create PR. Bitbucket Cloud opens to a pull request page for the branch.

Best practice for code reviews

Databricks supports Git branching.

  • You can link a notebook to your own fork and choose a branch.

  • We recommend using separate branches for each notebook.

  • Once you are happy with your changes, you can use the Create PR link in the Git Preferences dialog to take you to Bitbucket Cloud’s pull request page.

  • The Create PR link displays only if you’re not working on the default branch of the parent repository.


If you receive errors related to Bitbucket Cloud history sync, verify the following:

  1. You have initialized the repository on Bitbucket Cloud, and it isn’t empty. Try the URL that you entered and verify that it forwards to your Bitbucket Cloud repository.

  2. Your app password is active and your username is correct.

  3. If the repository is private, you should have read and write access (through Bitbucket Cloud) on the repository.