Bitbucket synchronized fork is not deleting branches that are deleted in upstream repository

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

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

In Bitbucket we expect that forks keep synchronized. In some cases, Bitbucket synchronized fork does not delete branches that are deleted in the upstream repository.

Is it possible to configure Bitbucket in a way that a branch is deleted in the forked repository when the upstream branch is deleted?

Cause

This is expected behavior. Branch deletions only get applied if the fork has the same branch at the same commit. If that's the case, then the sync automatically deletes the downstream branch. There is no mechanism to make it more aggressive about deleting branches than that.

Non-fast-forward updates aren't applied, which means if a team uses rebase-heavy workflows then the first rebase "breaks" synchronization to forks (as in, subsequent updates to the branch aren't applied), and then when the branch is deleted upstream the deletion is not applied either because the forked branch has fallen behind.

Solution

If your team workflow requires that the branch from the forked repo gets deleted when the one from upstream is deleted, you just need to ensure the fork has the same branch at the same commit.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.