Doc for "pushing to remote repos" is not accurate for setting up a mirror on Github

This report is about the documentation for pushing to a remote repository and its embedded parts in Gitlab.

Use case: I was trying to set up a mirror to have Gitlab.com as the primary repos and an automatic mirror on Github. I followed the instructions given in https://gitlab.com/matt.faure/Lamma2t/settings/repository, with section Push to a remote repository expanded.

It is written that:

If your HTTP repository is not publicly accessible, add authentication information to the URL: https://username:password@gitlab.company.com/group/project.git.

...which leads to confusion in two ways:

  • whether the repos is public or not, it seems to me the user has to give the credentials to write to a remote repos
  • a user could understand this is his/her Github password that has to be typed in (which does not work and brings an authentication error).

Instead, the user has to:

  1. Create a Github personal access token with the public_repo box checked
  2. Fill in the Git repository URL with the personal access token replacing the password https://GithubUsername:GithubPersonalAccessToken@github.com/group/project.git
  3. Save
  4. And either wait or trigger the "force update" button.

As having a mirror from Gitlab.com to Github seems (to me) to be a common use case, it would be interesting to enhance this part of the doc (for example by providing an example on how to setup a Github mirror).

(this would be related in a distant way with gitlab-org/gitlab-ce#35116)

cc @marcia and @axil (as we also live in the same city ;) )