I’m trying to migrate my GitHub repos to GitLab but would like to keep those repo’s in sync with a GitLab upstream for the social aspects of GitHub.
Since I’m on a Free acccount, I understand that I cannot pull(mirror) from GitHub but am getting an error message when I try to setup GitHub as a push(mirror) destination:
then the mirroring will work. I just did this with a private repository, rather than a public one. I selected the other appropriate options since I might make package releases and so want to be able for the mirror to delete if I delete on gitlab.
Accessing a private repository as a push mirror target should work if you’ve generated a token with all repo level access, and you’ve added your username to the URL when defining the destination.
Per your error, it looks like GitHub is rejecting the authentication attempt.
Have you verified if your generated GitHub personal access token works against the selected repository, with a CLI test using it?
Edit: Looks like my response overlapped with @iwalker’s fine one!
As it turns out, specifying the HTTP Mirror URL as https://balaji-dutt@github.com/balaji-dutt/repo was the key. Once I changed the URL, the push to the GitHub private repo started working.
FWIW, I was able to keep the token permissions to just repo access as seen in the screenshot:
For me worked creating the classic access token on github and then mirroring the repository on gitlab with: https://username:accesstoken@github.com/username/reponame