So I am going to migrate a bunch of repositories from bitbucket.org to a new on premise Bitbucket server instance.
What I can't decide on is whether to clone each repository as --bare or --mirror.
The scripted process seems pretty straight forward.
Get the repositories from bitbucket.org and write them to a file for use and to keep as a log. (already done and works)
Read the file, extract the repositories, repo slug(repo name) and clone them.(already working with --mirror)
For each cloned repo, run:
- git gc --auto to cleanup repos
- Create repo from slug on new on premise server
- git remote set-url origin ssh://on_prem_server:7999/PROJ/REPO
- git push --all origin
- git push --tags origin
So I am not actually mirroring the bitbucket.org repos but migrating them. My understanding is that git clone --mirror gives a true copy of original. While git clone --bare does not and needs at least a fetch afterwards. This is why I initially thought using --mirror was best.
But now I am worried that there could be some danger in using a mirror.
So my questions are.
- Are there any dangers using git clone --mirror I should be aware of?
- Should I even use --mirror or is --bare good enough?