I want to mirror GitLab repository to a bare Git repository which was hosted by Gitosis. As of Dec. 2020, GitLab Community Edition support “Push” only. “Push” means “mirror a GitLab (CE) repository to other Git repositories.”
Remote mirrors url is blocked: Requests to the local network are not allowed
.“Admin” -> “Settings” -> “Network” -> “Outbound Requests” -> “Allow requests to the local network from hooks and services”
ssh://git@gitosisrepo.com/myproject.git
. Of course, you can clone the URL :)Push “Mirror repository”, and your configuration would be registered if you configure the URL correctly.
Copy ssh pubkey by clicking the icon of click board.
(Apart from GitLab) Add the public key to the destination git repository. In my case, I configured add the SSH key under ‘gitosis-admin/keydir`, and if you want to mirror to other types of Git repository, like GitHub, Bitbucket, add the SSH public key from web pages.
(Optional) My case: configure gitosis-admin
of the destination repository (ssh://git@gitosisrepo.com/gitosis-admin
).
[group gitlab-mirrored-myproject]
members = git@mygitlab.com
writable = myproject