Bitbucket Cloud pull request "Unable to sync branch"

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

This knowledge base article explains why the "Sync now" button can't be used to synchronize your source branch with the destination branch in a pull request.

Diagnosis

  • In an existing pull request, you've noticed that there are several commits that are behind/ahead of the destination branch.

  • For example - the branch you are attempting to sync is "x commits behind another in a pull request".

  • You then clicked the Sync Now button. However, the following error message is displayed: "Unable to sync branch A wasn't synced with B".

Cause

The problem at hand is likely due to a branch restriction being configured for the source/destination branch, which prevents everyone or the specific logged-in user from directly pushing to the branch.

It's worth noting that the "Sync now" button essentially merges one branch with another, so this action requires write access to the source/destination branch.

Solution

To solve the problem, you can either:

  • Give "Write" permission to specific users/groups in the branch restriction settings for the source/destination branch

  • Temporarily disable the branch restriction for the source/destination branch so that you can proceed to sync branches

If the above instructions do not assist in resolving the issue, please raisea support ticket or raise a community support ticket for further assistance with this.

Updated on February 28, 2025

Still need help?

The Atlassian Community is here for you.