DEV Community

Matthew Odle
Matthew Odle

Posted on

8 3

Mirroring My Canvas Games Between GitLab and GitHub

I migrated my private projects to GitLab about 2 years ago when we started using it at work. I have nothing against GitHub, but I really like GitLab's interface. The problem is GitHub is THE place to host your stuff if you want others to have easy access to it. This meant I had to maintain two different remotes for every project.

Today, I fixed that.

GitLab's mirror push interface is really easy to use. You can access it via Settings > Repository > Push to a remote repository.


Usage:

  • Add the GitHub project's URL with the proper credentials to the 'Git repository URL' field
  • Click 'Update Now'
  • GitLab will show:
  • GitHub will show:

Woo.

Sources:

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (3)

Collapse
 
lcavalli profile image
lcavalli

Aren't you storing your GitHub password in clear in GitLab options this way?

Collapse
 
matthewodle profile image
Matthew Odle

You are. Use at your own risk. Alternately you can set up a GitHub token and use that instead.

Ideally this would be done using ssh and post-receive hooks on your hosted GitLab, but with the goal being to automate my hobby workflow, spinning up my own GitLab seemed excessive.

If you have an alternative for automatically mirroring to GitHub, I would absolutely love to hear it.

Other options I've used are:

  • dual remotes on each project; manually pushing updates (less than ideal, one more step to forget)
  • custom bash script to push to both remotes for you (less than ideal, I switch workspaces often)
Collapse
 
derchrisuk profile image
Christian Gerbrandt

This is not available with the Gitlab CE version.

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay