Lesstep
Bitbucket Cloud · Sync now · Checked November 10, 2026

Bitbucket Cloud: "Unable to sync branch"

The pull request says the source branch is some commits behind the destination. You press Sync now, and Bitbucket answers "Unable to sync branch" with "feature wasn't synced with main" (your branch names in place of these). Sync now merges one branch into the other, so it writes to the branch, and the usual cause is a branch restriction that doesn't let you push to the source or destination branch (Atlassian's knowledge base, Bitbucket Cloud pull request "Unable to sync branch").

Why it fails

To see which pull requests have fallen behind: Pull Request Inbox for Bitbucket, a plugin for JetBrains IDEs, shows next to each pull request which merge checks block it, a limit on commits behind the destination among them.

Fix it

Sync in a clone instead

A sync is a merge you can make yourself. Merge the destination into the source branch:

git fetch origin
git checkout feature
git merge origin/main
git push origin feature

Or rebase, then push with a lease so you don't overwrite a push you haven't seen:

git fetch origin
git checkout feature
git rebase origin/main
git push --force-with-lease origin feature

The push needs write access to the branch too: if the restriction is on it, Bitbucket refuses the push with pre-receive hook declined (what that means). So this helps when the restriction is on the other branch or the sync fails for another reason. If the two branches conflict, resolve the conflict in the clone before you push (resolving merge conflicts).

You have write access and it still fails

In the community question develop wasn't synced with master, the branches had no conflicts and the user had access. Atlassian's answer was to sync in a clone as above, and to find the cause: open the browser's developer tools on the Network tab, press Sync now again, and look for a request that returns a 4xx or 5xx status and what its Response says. Send that to Atlassian support.

Bitbucket pull requests in IntelliJ IDEA

Pull Request Inbox for Bitbucket, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the pull requests that wait for your review in an IDE tool window, with their diffs and discussions, and shows next to each which merge checks pass and which block the merge, such as "At most 5 commits behind the target branch" when your repository sets that limit. The review inbox, diffs, discussions and merge checks are free; approving, commenting and merging are Pro, with a 30-day trial. It also works with Bitbucket Data Center (beta).

Get it on JetBrains Marketplace

Bitbucket and Atlassian are trademarks of Atlassian; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by Atlassian or JetBrains.

More: Merge checks · Bitbucket merge strategies · pre-receive hook declined · 日本語