Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to copy a repository between two different Bitbucket environments

esranur doğan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 16, 2026

How to copy a repository between two different Bitbucket environments.

I have two different Bitbucket environments. I want the repositories to progress in the same way between them.

1 answer

0 votes
Founder - NewSysRS
Atlassian Partner
April 13, 2026

There are a few ways to do this, but the "cleanest" way to ensure you don't lose your commit history, branches, or tags is to do a mirror push via your local machine. You don't need any special tools—just a standard terminal.

​1. Create the target repo:

First, go to your new Bitbucket workspace/account and create a brand-new, empty repository. Don't initialize it with a README or .gitignore yet.

​2. Clone the original as a "bare" repo:

This pulls down all the metadata and branches without the working files.

git clone --bare https://bitbucket.org/OLD_WORKSPACE/old-repo.git

​3. Move into that folder:

cd old-repo.git

​4. Mirror push to the new home:

git push --mirror https://bitbucket.org/NEW_WORKSPACE/new-repo.git

​5. Clean up:

You can now delete the old-repo.git folder on your local machine and clone the new repo normally.

​A few things to keep in mind:

​Permissions: Make sure your SSH key or App Password has "Write" access to the new destination.

​Pull Requests and Pipelines: This moves code and history, but it won't move your PRs or build history.

​LFS: If you use Git LFS, you’ll need to run "git lfs fetch --all" and "git lfs push --all" to move those assets.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events