Is there a way to move an entire repository from Github to GitLab?
For the code itself, this would be a simple matter of creating a new repo on GitLab and pushing to it.
Wiki pages live in a separate branch on Github and are managed with Git mechanisms; AFAIK the same goes for GitLab. Same story for pages.
That leaves issues and merge requests as the main open points. Is there a way to copy those from Github to GitLab, at least in the state they were in at the time of the migration?
Github offers an export ferature, and GitLab has an import feature which can import a Github repository—do any of these help with the above?
Transferring a repository owned by your organizationSign into your personal account that has admin or owner permissions in the organization that owns the repository. On GitHub.com, navigate to the main page of the repository. Under your repository name, click Settings. Under "Danger Zone", click Transfer.
premium. GitLab CI/CD can be used with GitHub.com and GitHub Enterprise by creating a CI/CD project to connect your GitHub repository to GitLab.
In the upper-right corner of any page, click , and then click Import repository. Under "Your old repository's clone URL", type the URL of the project you want to import. Choose your personal account or an organization to own the repository, then type a name for the repository on GitHub.
GitLab’s import feature has worked quite nicely.
Import will take a couple of minutes. When it finishes, you will get your entire repo, including wiki, issues and merge requests. Issues and merge requests will retain ticket numbers as on Github, and labels also seem to get migrated.
Github Pages do not seem to get migrated automatically. This requires some manual steps. For purely static content (no SSG), with content stored in the gh-pages
branch, the process is as follows:
gh-pages
branch.public
and move all content there.master
and merge gh-pages
(so that your content now resides on a separate folder in master
rather than its own branch)..gitlab-ci.yml
file; add the following content and commit:image: alpine:latest
pages:
stage: deploy
script:
- echo 'Nothing to do...'
artifacts:
paths:
- public
only:
- master
This will take another few minutes. Navigate to Settings > Pages and click the link to your pages.
Github has multiple options for storing web content; the above may also work for others with slight modifications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With