Reputation: 21
What difference does it make if we mirror a repository from an organization we are in, or import a repository while creating a new one. Are there any specific advantages?
Upvotes: 2
Views: 1029
Reputation: 30878
From Github docs Mirroring a repository and Importing a Git repository using the command line, we can see the commands are the same, git clone --bare
and git push --mirror
. So I think they are the same thing in Github.
But when it comes to Git, mirror
reminds me of git clone --mirror
and git push --mirror
. There are differences between --mirror
and --bare
. If you want to preserve all refs in the server repository, use git clone --mirror
. If you want to preserve only branches and tags, use git clone --bare
. As to all refs
, they are builtin types of refs like branches, tags, notes, etc. The hosting service may use some special customized refs that cannot be fetched by git clone --mirror
.
Upvotes: 1