Edit: please refer to the docs instead: https://docs.gitlab.com/ee/user/project/repository/mirror/push.html#set-up-a-push-mirror-from-gitlab-to-github
Now that github doesn’t allow password based authentication anymore, it is necessary to use ssh key based authentication methods when setting up a repository mirror.
You should do the following:
First, you should copy the SSH URL. It will look somewhat like this:
[email protected]:meesvandongen/ddragon-webp.git
The URL gitlab is expecting however takes a somewhat different form:
ssh://[email protected]/meesvandongen/ddragon-webp.git
So, modify the URL to take this form.
Go to the repository you want to mirror on gitlab, and choose settings > repository > Mirroring repositories.
Here,
Below the setting for adding new repository mirrors is a list of currently mirrored repositories. For the ssh-based repositories, a button is shown, which must be used to copy the SSH key that gitlab will use for authentication on the remote repository.
Now all that remains is allowing the SSH key on github. On github, under Settings > Deploy keys > Add new, you can paste the key copied in the previous step. Be sure to check allow write access if the direction is push.
After this, everything should work as expected.