'What is the fastest way to transfer all of my GitHub repositories to GitLab?

I'm looking to move entirely away from GitHub to GitLab as easily as possible.



Solution 1:[1]

You can import your GitHub projects into GitLab. If you already have a gitlab account, just go to new (+) --> project --> import --> github. More info in: https://gitlab.com/import/github/new

Solution 2:[2]

1. Begin creating a GitLab project

In GitLab, choose to create a new project, then go to the Import project tab (instead of the default Blank project). From th e list of available platforms to automatically import from, select the second option GitHub.

2. Create person access token

You will now need to give GitLab a personal access token that you initiate from GitHub. Login to GitHub and navigate to your per sonal settings. From there, select Developer settings, then Personal access tokens, then click Generate new token. Complete the form that you are prompted with; the repo scope setting is sufficient for basic transferring. Be sure to copy the token to your clipboard when finished.

3. Add personal access token to GitLab

Paste your personal access token into GitLab, then click List your GitHub repositories.

4. Import the desired projects

On the rightmost column with the header Status, choose to import all projects that you would like. If you would like to import all repositories at the same time, you can select the green button Import all repositories at the top.

For more information, please refer to the detailed post by GitLab on the topic by clicking on the image or link below:

enter image description here

https://docs.gitlab.com/ee/user/project/import/github.html

Solution 3:[3]

Just add a GitLab repo as another remote repo on your local repository and push to it.

Solution 4:[4]

Please follow this, i think this will be helpful for you. 1. Create a project repository in gitlab. 2. Then your existing project repository added another remote url.(git remote add 'name' 'new repository') 3. And Then push your project to that remote url. (git push 'name' master.)

Solution 5:[5]

Note that GitLab 14.10 (April 2022) does simplify the process:

Importing from GitHub defaults to the current group path

When importing from GitHub, this milestone changes the default destination for imported projects to the contextual namespace of the GitLab group from which you started the import.

Previously, GitHub projects imported to your personal namespace.

This usability enhancement helps users import projects in a more intuitive way and doesn’t place imported projects in confusing locations.

https://www.youtube.com/watch?v=yKaf4LeEFoU

See Documentation and Issue.


And it comes with:

View history of all project imports on a single page

The new Project import history page lists all project imports, regardless of where they were imported from. This view consolidates information that was previously scattered on the import pages of each individual importer.

Having all the details about previous imports in one view gives you a single place to find and review the status of all previous imports. This includes details on imports that failed, so that you can verify that you successfully imported all the intended projects.

https://about.gitlab.com/images/14_10/view_history_of_all_project_imports_on_a_single_page.png -- View history of all project imports on a single page

See Documentation and Issue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ariel Mirra
Solution 2
Solution 3 eftshift0
Solution 4 sajan giantssoft
Solution 5 VonC