Forums

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

bitbucket BACKUP

Денис И
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!
July 28, 2021

How to back up all your data Repositories? 

1 answer

1 accepted

0 votes
Answer accepted
Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 28, 2021

Hi, @Денис И! Welcome to the community! 

As Git is a distributed version control, any clone/pull of the repository is essentially a full copy of your code.

As best practice to make backups of your Bitbucket contents, you can create local backups using clones from Bitbucket, more specifically mirror clones as it copies all your repository references locally. You can achieve this by running the following command:

git clone --mirror <repoURL>

The --mirror flag clones all branches and commits of the specified repository. 

Please note that metadata such as settings and Pull requests wouldn't be part of this backup, you would need to re-create this data from scratch if you lost the repository. 

Following our suggestion to clone a repository locally as a mirror, you might have questions on how to turn a mirror repository (bare) into a normal repository (non-bare). For that, you can push the mirror-cloned repository into Bitbucket and then clone it without the mirror flag, it will automatically do that for you. 

With that said, we would like to inform you that we have an open feature request to implement a backup functionality in Bitbucket. You can check this request here: 

Please consider adding yourself as a watcher, this way you get updated as we make progress with this. If you are not familiar with our Feature Request Policy, you can learn more about it here.

I hope this information helps, but please let me know if you have any other questions.

Kind regards,
Caroline

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events