GitLab has a mirror feature:
https://docs.gitlab.com/ee/user/project/repository/mirror/
and GitHub does not support simple password authentication. I tried to follow
https://meesvandongen.nl/posts/mirror-gitlab-github
Using the target url
ssh://git@github.com:stefaneidelloth/mirror_demo.git
and SSH public key
as authentication method.
However, I get an error
Remote mirrors url is blocked: URI is invalid
from GitLab.
If I specify the target url
https://github.com/stefaneidelloth/mirror_demo.git
I am not able to select SSH public key
as authentication method.
=> What are the right settings to mirror a GitLab project to a GitHub project (without PREMIUM edition of GitLab)?
Edit
The second :
needs to be replaced with a /
.
Suggested by GitHub:
Adding ssh://
prefix is not enough.
Wrong: ssh://git@github.com:stefaneidelloth/mirror_demo.git
Still need to replace :
after github.com:
Right: ssh://git@github.com/stefaneidelloth/mirror_demo.git
Then GitLab generates the SSH key for the connection and one needs to copy it to the GitHub project settings (not the user settings), see https://meesvandongen.nl/posts/mirror-gitlab-github
Now I get the next error:
13:get remote references: create git ls-remote: exit status 128, stderr: "ssh connect to host github.com port 22: Connection timed out\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n".
a) Do I need to specify a different port than 22? How? I tried
ssh://git@github.com:443/stefaneidelloth/mirror_demo.git
but that did not help.
b) Do I need to use "Input host keys manually"? What should be specified? I tried to use
SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s
from
but that did not help.
c) I also tried to generate a GitHub AccessToken in the user settings and apply it for the password option of the GitLab Mirror settings. I tried both, https://
and git://
urls. No success.