How to create a new repository on every release branch

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

Summary

When working on a repository and managing release branches, users might prefer to deal with each branch as its own separate repository, completely unrelated to its original repository.

Environment

This article is related to Bitbucket Cloud only.

Solution

For these cases, this can be achieved by following these steps:

  1. Create a new repository to host the "release" version of your main repository;

  2. Perform a mirror clone of the original repository 

    1 $ git clone --mirror <repo_url>
  3. Navigate to the mirror clone and change the local remote URL to the "Release" repository 

    1 2 $ cd repository.git $ git remote set-url origin <release_repo_url>
  4. Force push the contents of the mirror clone to the new remote 

    1 $ git push -f

Updated on March 17, 2025

Still need help?

The Atlassian Community is here for you.