DEV Community

Cover image for Migrating repository from github to gitlab
Olawale Adepoju for AWS Community Builders

Posted on • Originally published at dev.classmethod.jp

4

Migrating repository from github to gitlab

I will be showing how I migrated a repository from GitHub to GitLab. There are two methods;

Option 1
Firstly you can do it on the console by going to GitLab and authenticating your GitHub credential there and you will be able to import all the repositories you want on GitLab.

  • Log in to your GitLab, and create a new project

Image description

  • Choose the import project option

Image description

  • Choose the GitHub option

Image description

  • It will show the option of Authorization from GitHub.

Image description

  • you can import all repositories or choose the repository to be migrated. Also, there is an option of importing issues pull request events.

Image description

Option 2
The second option, let's say your GitHub is in a private network and you want to take one repository and push it to GitLab, where GitLab is on some other network or hosted in some other cloud environment. How do you migrate in this case?

  • Clone the GitHub repository you want to migrate. use
git clone --bare <GitHub URL>
Enter fullscreen mode Exit fullscreen mode

Image description

  • Create a new project in GitLab, and choose the create the blank project option

Image description

  • Give a project name and click create project.

Image description

  • Push the cloned repository to GitLab.
git push --mirror <GitLab URL>
Enter fullscreen mode Exit fullscreen mode

Error Alert: while I push to GitLab I encountered an error

Image description

How did I solve it?
Go to project: "Settings" → "Repository" → "Expand" on "Protected branches" and click on unprotect.

Image description

Now the GitHub repository is migrated successfully to GitLab

Image description

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (2)

Collapse
 
jordantylerburchett profile image
Jordan-Tyler Burchett

Nice tutorial!

Collapse
 
jatinmehrotra profile image
Jatin Mehrotra

Classmethod <3

Best Practices for Running  Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK cover image

Best Practices for Running Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK

This post discusses the process of migrating a growing WordPress eShop business to AWS using AWS CDK for an easily scalable, high availability architecture. The detailed structure encompasses several pillars: Compute, Storage, Database, Cache, CDN, DNS, Security, and Backup.

Read full post