How to create a new repository on every release branch

robotsnoindex

Platform Notice: Cloud - This article 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 

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

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

    $ git push -f



Last modified on Mar 17, 2025

Was this helpful?

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