How to back up all your data Repositories?
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
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.