Costa Rica
Last updated: 2026-01-25
Migrating a repository from GitLab to GitHub involves exporting your code and history, setting up a new GitHub repository, and carefully transferring issues, CI/CD pipelines, and permissions. The process is straightforward for code but requires extra steps for workflows and collaboration data.
List of References (Click to expand)
| Aspect | GitLab → GitHub Migration Notes |
|---|---|
| Code & History | Easy with git clone --mirror and git push --mirror. |
| Issues | Requires API tools or manual import; labels may need rework. |
| CI/CD | Pipelines must be rewritten for GitHub Actions. |
| Wiki | Can be cloned/pushed separately as another repo. |
| Permissions | Must be recreated manually in GitHub. |
| Integrations | GitHub offers broader ecosystem (Actions, Copilot, Codespaces). |
Note
Preparation:
- Audit your GitLab repo: Check branches, tags, issues, merge requests, and CI/CD pipelines.
- Decide scope: Are you migrating just the code, or also issues, wiki, and pipelines?
- Access setup: Ensure you have admin rights on both GitLab and GitHub.
E.g Repo of 4.2 GB:
project-storage-example.mp4
History example:
gitlab-history-example.mp4
-
Clone your GitLab repository:
git clone --mirror https://gitlab.com/username/repo.git
--mirrorensures all branches, tags, and refs are included.
E.g
-
Create a new repository on GitHub (empty).
create_new_GH_repo_example.mp4
E.g:
-
Push the mirrored repo to GitHub:
cd repo.git git push --mirror https://github.com/username/repo.gitE.g:
At this point, your code and commit history are fully migrated.
E.g:
github-history-example-migration.mp4
Note
Some metadata (labels, assignees) may need manual adjustment.
- GitHub does not natively import GitLab issues.
- Options:
- Third-party tools: e.g., gitlab2github or Python scripts that use GitLab/GitHub APIs.
- Manual export/import: Export issues from GitLab as JSON/CSV, then use GitHub’s API to recreate them.
- GitLab CI uses
.gitlab-ci.yml; GitHub uses GitHub Actions (.github/workflows/*.yml). - Migration requires rewriting pipeline definitions:
- Map GitLab jobs to GitHub Actions workflows.
- Replace GitLab-specific runners with GitHub-hosted runners.
- Test workflows thoroughly after migration.
- Recreate teams and permissions in GitHub.
- GitHub offers Organizations, Teams, and Role-based access control.
- If migrating multiple repos, consider using GitHub Enterprise migration tools.