---
updatedAt: 2026-11-05T17:18:22.000Z
agentTools:
  siteIndex: https://docs.readme.com/llms.txt
  siteSearch: https://docs.readme.com/agentSearch?query=term1%20term2
  projectIndex: https://docs.readme.com/main/llms.txt
  projectSearch: https://docs.readme.com/main/agentSearch?query=term1%20term2
---

# Sync with Bitbucket

Connect your project to a Bitbucket Cloud repository for bi-directional sync, including the app you install, how to disconnect, and how branch restrictions behave.

## How to Set Up Bi-Directional Sync with Bitbucket

ReadMe connects to Bitbucket Cloud through the **ReadMe Sync** app. A workspace admin installs the app once, and it adds a **ReadMe Bi-Directional Sync** page to each repository's settings. After that, a repository admin can connect any empty repository in the workspace to a ReadMe project with a verification code.

### Prerequisites

* You need to be an admin of the ReadMe project.
* You need admin access to the Bitbucket repository you're connecting.
* A Bitbucket workspace admin needs to install the ReadMe app. If that isn't you, ask them to install it first.
* The repository must be **empty**, with no commits or branches, not even a README.

On an Enterprise group? See [Bitbucket Enterprise Sync](/main/enterprise/bitbucket-enterprise-sync).

### Set Up

1. Navigate to the **Settings** > **Git Connection** page.
2. Select **Bitbucket**.
3. If you haven't already, [create an empty repository in Bitbucket](https://support.atlassian.com/bitbucket-cloud/docs/create-a-git-repository/). Set **Include a README?** to **No**.
4. Click **Install Forge App** and install the app on the workspace that owns the repository. Skip this if the app is already installed there.
5. Back in ReadMe, click **Generate Verification Code** and copy the code. It's valid for 15 minutes.

<Image src="https://files.readme.io/53b3dd9d1dc408d7fdff98e2cbc1b3be4ff4cb5214a5e182592d3b06781101fe-readme-bitbucket-setup.png" align="center" framed={true} />

6. In Bitbucket, open the repository and go to **Repository settings** > **Forge Apps** > **ReadMe Bi-Directional Sync** (under **ReadMe Sync**).
7. Paste the code and click **Connect Repository**.

<Image src="https://files.readme.io/93a931fc1c5ec72d98970b2e0c0acd48195e7017b522b4ae000ecbf452b488d4-bitbucket-forge-connect.png" align="center" framed={true} />

ReadMe moves on to the connected view by itself once the code is accepted, and starts the first sync. If the code expires first, generate a new one.

<Callout icon="⚠️" theme="warn">
  ReadMe checks that the repository is empty both in Bitbucket and again before the first sync. If the repository has any branch, the connection is refused and nothing is written to it. Create a new, empty repository and try again.
</Callout>

***

## Disconnecting

### From ReadMe

1. Go to **Settings** > **Git Connection**.
2. On the **Docs repository** card, click **Connected** and choose **Disconnect Repository**, then click **Disconnect** to confirm.

Your content stays in the Bitbucket repository, and ReadMe tells the app that the repository is no longer connected. You can't reconnect a project to the same repository afterwards, because it isn't empty anymore. To sync again, connect a new empty repository.

### From Bitbucket

You can't disconnect a single repository from Bitbucket; the app's page in repository settings points you back to ReadMe. If you uninstall the app from the workspace, or it loses access to the repository, sync stops and ReadMe shows **Repository not accessible** on the Git Connection page. The project stays linked until you disconnect it in ReadMe, so finish there.

To manage the app's installation, click the workspace name in the connection dropdown at the top of **Settings** > **Git Connection**. It opens your workspace's app settings in Bitbucket.

***

## Changing Repositories

1. Within ReadMe, disconnect the project as above.
2. Within Bitbucket, create a new empty repository in a workspace where the app is installed.
3. Return to ReadMe, generate a new verification code, and enter it in the new repository's **ReadMe Bi-Directional Sync** settings.

***

## Bitbucket Branch Restrictions

If your Bitbucket repository uses branch restrictions, you'll need to give the ReadMe Sync app write access to your synced branches. ReadMe pushes commits directly to those branches as the app, not as a user, and doesn't bypass your restrictions automatically. If a restriction blocks the push, **Settings > Git Connection** in ReadMe reports `Push rejected: the target branch is protected` for the affected branch, and changes stop flowing in both directions for that branch.

1. In Bitbucket, go to **Repository settings** > **Branch restrictions**.
2. Edit the restriction that covers the synced branch.
3. Under **Write access**, choose **Only specific people, groups or pipeline branches have write access** if it isn't already selected.
4. Search for *ReadMe Sync* (Forge app), add it, and click **Save**.

<Image src="https://files.readme.io/4e98d1ddbbc4f9dd620d6f83c65e8c825c402b3c38eb9fc31a43bacef919258a-bitbucket-branch-restriction.png" align="center" framed={true} />

A few things to check if the error persists:

* Do this for every restriction that applies to a synced branch, including `main`.
* Restrictions set at the project level apply on top of repository restrictions and need the app added too, under **Project settings** > **Branch restrictions**.
* If your restrictions are managed by an automated tool, make the change in that tool so it isn't reverted on the next run.
* After updating the restrictions, save a small change in ReadMe or push a commit to trigger a new sync, then confirm the error has cleared on **Settings > Git Connection**.

For the full list of symptoms, see [Troubleshooting](https://docs.readme.com/main/docs/bi-directional-sync#troubleshooting) on the Bi-Directional Sync page.

***

## FAQ

<Accordion title="What permissions does the Bitbucket app need?">
  The ReadMe Sync app requests read and write access to repositories, to sync content in both directions, and read access to the workspace. A workspace admin installs it, and only a repository admin can connect a repository.
</Accordion>

<Accordion title="Is Bitbucket Server or Data Center supported?">
  No. Only Bitbucket Cloud is supported.
</Accordion>

<Accordion title="Bitbucket says I need admin access to connect.">
  Connecting writes to the repository, so only repository admins can enter the verification code. Ask a repository admin to do it, or to give you admin access.
</Accordion>

<Accordion title="Bitbucket says the repository can't be connected.">
  The repository isn't empty. ReadMe only connects to repositories with no commits or branches. Create a new, empty repository and connect that instead.
</Accordion>

# Sibling pages

* [Sync with GitHub](https://docs.readme.com/main/docs/sync-with-github.md)
* [Sync with GitLab ](https://docs.readme.com/main/docs/sync-with-gitlab.md)
* [Documentation Structure](https://docs.readme.com/main/docs/documentation-structure.md)