Publish your GitLab project to Github

Jul 24, 2025 by Thibault Debatty | 62 views

GitLab DevOps

https://cylab.be/blog/431/publish-your-gitlab-project-to-github

Have a GitLab repository? Want to give it more visibility? Here is how to automatically mirror your GitLab repository to Github

Create Github project

Login to your github account then head to https://github.com/new to create a new public repository.

github-create-repo.png

No need to add a README file or gitignore, the repo can be left completely empty…

Create Personal Access Token (PAT)

Still on GitHub:

  1. Open Settings > Developper settings (at the verry bottom) > Personnal Access Tokens > Fine-grained tokens and click Generate new token.
  2. Provide a name, description and expiration for the token (if needed)

github-access-token.png

  1. Under Repository access, click Only select repositories and choose the desired repository
  2. Under Permissions, select Repository permissions > Contents > Read and write

github-token-repository.png

Create the token and don’t forget to save the token value as it will only be displayed once!

Create repository mirroring

Now, on the GitLab server, open the source project, and head to Settings > Repository > Mirroring repository. Then click on Add new.

  • Enter the https URL of the GitHub repository (with the .git at the end)
  • In the Password field, enter the Personal Access Token you just created

gitlab-repo-mirroring-github.png

Once the mirroring is configured, click on the spinning arrows to run the initial push.

gitlab-mirroring-repositories.png

After a few seconds your Github repo should be a mirror of your gitlab repository, and GitLab will update the Github repo each time you push new commits…

github-docker-hello.png

This blog post is licensed under CC BY-SA 4.0

This website uses cookies. More information about the use of cookies is available in the cookies policy.
Accept