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:
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.
--mirror just means to copy all refs "as-is" (instead of, for example, copying only branches and mapping them to remote tracking refs). Your use case is within its range of intended purposes.
(Just to clarify - --bare also maps refs directly rather than creating remote tracking refs form branches, but it doesn't copy all the refs like --mirror.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With