How to sync Github to Gitlab

I, like a lot of people who have used Git, started out using Github. But I became a bit frustrated by the lack of some features that Gitlab had, but Github didn’t (unlike many, the decision to switch to Gitlab wasn’t because of Microsoft’s takeover of Github).

However, very few online code editors worked with Gitlab, while many would work with Github. While it isn’t a big hassle, time spent doing manual tasks (i.e. uploading and downloading files) adds up. Although Gitlab has a web IDE, I prefer using a dark mode and it doesn’t have the functionality that some other IDEs (Codeanywhere and Gitpod, for example) have.

To solve this, I decided to sync my Github repositories to Gitlab. If I make a change on Github, it will be reflected on the Gitlab project.

Photo by Pankaj Patel on Unsplash

What you’re going to want to do is to sign up for Github, if you haven’t already. Create a repository on Github, or choose the one that you want to sync to Gitlab.

If you haven’t signed up for Gitlab, sign up now, choosing the “sign up with Github option”. If you’ve already signed up for Gitlab, go to your settings and find the button that says “connect to github”.

All the services that can be connected to Gitlab

Once you’ve connected your github and gitlab accounts, click the little + button to the left of the search bar. Click “new project”.

The new project area

You are then going to want to click on the tab that says “CI/CD for external repo”. Click “Connect repositories from Github.” Select your project (it can be a personal repo or a corporation repo). It will take a few minutes to sync, and then you’re done!

Please note that while changes on the github repo will be reflected on gitlab, if you change something on gitlab, it won’t be reflected on Github.

Enjoy!

— Limo

#github

How to sync Github to Gitlab
28.45 GEEK