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

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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.

Last modified on Nov 30, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.