The Vercel for Bitbucket integration automatically deploys your Bitbucket projects with Vercel, providing Preview Deployment URLs, and automatic Custom Domain updates.

Commits pushed to Bitbucket are automatically built and deployed with Vercel.

Connecting with Bitbucket

Link your Bitbucket account with your personal account or team on Vercel from your dashboard by clicking "Import Project" followed by "From Git Repository". Then, click the "Bitbucket" tab and click "Connect with Bitbucket".

Vercel for Bitbucket, ready to connect.

Once you have authorized the Bitbucket integration, you will be redirected back to the "Import Git Repository" page where you can import a project from an existing repository by clicking the "Import Project from Bitbucket" button under the "Bitbucket" tab.

For more information on deploying projects, read the Vercel introduction documentation.

Change or Disconnect from your Bitbucket Repository

If you’d like to:

  • Change the Bitbucket repository your project is connected to
  • Disconnect your project from your Bitbucket repository

You can do so from the "Git Integration" fieldset on Project Settings.

More Information About Vercel for Bitbucket

For more information, such as a reference for default environment variables, expand the relevant details view below.

A Deployment for Each Push

Vercel for Bitbucket will deploy each push by default. This includes pushes and pull requests made to branches. This allows those working within the project to preview the changes made before they are pushed to production.

With each new push, if Vercel is already building a previous commit, the current build will be canceled to build the most recent commit so that you always have the latest changes deployed as quickly as possible.

Updating the Production Domain

If Custom Domains are set from a project domains dashboard, pushes and merges to the Production Branch (commonly "main") will be made live to those domains with the latest deployment made with a push.

If you decide to revert a commit that has already been deployed to production, the previous Production Deployment from a commit will automatically be made available at the Custom Domain instantly; providing you with instant rollbacks.

Preview URLs for Each Pull Request

The latest push to any pull request will automatically be made available at a unique preview URL based on the project name, branch, and team or username. These URLs will be given through a comment on each pull request.

A preview URL created from a pull request.

You may want to use different workflows and APIs based on Git information. To support this, the following System Environment Variables can be added to your deployment:

An indicator for whether the app was deployed by Vercel for Bitbucket. Example: 1.
The Bitbucket user or team that the project belongs to. Example: acme.
The slug of the Bitbucket repository that was deployed. Example: my-site.
The name of the Bitbucket repository that was deployed. Example: my-site.
The Bitbucket branch that the deployment was triggered by. Example: improve-about-page.
The Bitbucket sha of the commit the deployment was triggered by. Example: fa1eade47b73733d6312d5abfad33ce9e4068081.
The message accompanying the Bitbucket commit that was deployed. Example: Add John Doe to about page.
The name of the commit author on Bitbucket. Example: John Doe.
Bitbucket profile URL of the commit author. Example:

To disconnect your personal account or team on Vercel from Bitbucket, take the following steps:

First, log into Bitbucket, click on your profile icon on the bottom left, and select Bitbucket settings.

Bitbucket Settings.

Next, from Access Management, select OAuth.

OAuth Settings.

Finally, from OAuth integrated applications, locate Vercel and click the Revoke link next to it.

Revoking access.

After disconnecting, you can always reconnect your Vercel account to a Bitbucket account again.

To sign up on Vercel with a different Bitbucket account, sign out of your current Bitbucket account:

Sign out of Bitbucket.

Then, restart the Vercel signup process.

Last Edited on August 4th 2020