Skip to content

Latest commit

 

History

History
120 lines (77 loc) · 4.64 KB

File metadata and controls

120 lines (77 loc) · 4.64 KB

From GitLab to GitHub - Overview

Costa Rica

GitHub brown9804

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.

Repository Migration (Code + History)

E.g Repo of 4.2 GB:

image
project-storage-example.mp4

History example:

gitlab-history-example.mp4
  1. Clone your GitLab repository:

    git clone --mirror https://gitlab.com/username/repo.git
    • --mirror ensures all branches, tags, and refs are included.

    E.g

    image
  2. Create a new repository on GitHub (empty).

    create_new_GH_repo_example.mp4

    E.g:

    image
  3. Push the mirrored repo to GitHub:

    cd repo.git
    git push --mirror https://github.com/username/repo.git

    E.g:

    image image

At this point, your code and commit history are fully migrated.

E.g:

image
github-history-example-migration.mp4

Issues and Comments

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.

CI/CD Pipelines

  • 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.

Permissions and Collaboration

  • 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.
Total views

Refresh Date: 2026-03-26