Skip to main content

Configure Source Control with Bitbucket

Learn how to set up Source Control with Bitbucket.

With Source Control with Bitbucket, you can use pull requests on Bitbucket cloud to manage changes to your Retool applications.

Setup instructions

Disable git syncing

If you've enabled Git Syncing, disable it:

  • In your docker.env file, set DISABLE_GIT_SYNCING=true and VERSION_CONTROL_LOCKED=false.
  • In the Settings > Advanced tab in Retool, remove the repository URL and branch name from your Git Syncing configuration.

Prerequisites

This guide requires access to a Bitbucket account with permissions to create workspaces and repositories.

1. Create a Bitbucket app password

  1. Create a Bitbucket app password.
  2. On the app password page under Permissions > Repositories, select Read, Write, Admin, and Delete. This gives the app password the ability to access and modify the repository containing your Retool apps.

2. Create a new Bitbucket workspace and repository

  1. Create a Bitbucket workspace for your Retool repository.
  2. Create a Git repository in Bitbucket for your Retool apps.

Create a new Bitbucket repository

3. Configure Bitbucket repository settings

Go to the Source Control settings, and select Set up Bitbucket. Enter the following settings.

SettingDescriptionExample
Bitbucket UsernameThe Bitbucket usernameretool
Bitbucket WorkspaceThe workspace name in step 2. This variable is case-sensitive.retool-space
Bitbucket RepositoryThe repo name in step 2.retool-apps
Bitbucket BranchRetool automatically tracks changes to this branchmain
Bitbucket URLThe domain used to access your self-hosted Bitbucket instance.https://bitbucket.org/
Bitbucket Enterprise API URLThe REST API route for your self-hosted Bitbucket instance. Defaults to https://api.bitbucket.org/2.0.https://api.bitbucket.org/2.0
Bitbucket App PasswordThe app password you generated in step 1.loDJlwRetoolTYXOFbO

Configure Bitbucket settings on Retool

4. Test your configuration

After you set up your environment variables, if you’re an admin on your Retool instance, you can visit Settings > Source Control.

If your Bitbucket environment is correctly configured, the page will show your Bitbucket commits in the Deployment Dashboard section. You can also click the Test connection button, which sends a request to test the connection.

Deployment dashboard and test connection example

If you don't see the Deployment Dashboard and your Bitbucket commits on Settings > Source Control, check that your environment variables are correctly configured.

What's next?

You are now ready to use source control. Learn how to create branches, pull requests, merging changes, and use other source control features in the getting started guide.