GitLab to GitHub migration guide: repositories, pipelines and the cutover
Moving one repository from GitLab to GitHub takes two commands. Moving a company takes a plan. The git history is the easy part. Pipelines, permissions, secrets and the habits of every developer are where a GitLab to GitHub migration is won or lost. This guide follows the order we use on real moves, including one of 1,700 repositories and 239 pipelines.
Step 1: Take an inventory
You cannot plan what you have not counted. For every project, record:
- Size, last commit date and whether it uses Git LFS
- Whether it has a pipeline, and which runners it needs
- CI/CD variables and where each secret is used
- Webhooks, deploy keys and integrations
- Container or package registry usage
- Open merge requests and issues that matter
Expect to find that a large share of repositories have not been touched in years. Archive them rather than migrate them actively. That one decision often halves the work.
Step 2: Know what moves cleanly and what does not
Moves cleanly: commits, branches and tags. A mirror clone carries all of it.
git clone --mirror [email protected]:acme/billing.git
cd billing.git
git push --mirror [email protected]:acme/billing.git
Needs an extra step: LFS objects, which are not part of a mirror push.
git lfs fetch --all
git lfs push --all [email protected]:acme/billing.git
Needs a tool or a script: issues, merge requests and their comments. GitHub's import tools change over time, so check the current documentation for what they carry over from GitLab before you promise the team their review history.
Needs rebuilding: pipelines, runners, secrets, webhooks, branch protection and anything in a package registry.
One hard limit to check early: GitHub rejects files larger than 100 MB in a normal push. Find them in the inventory and move them to LFS first.
Step 3: Convert pipelines to GitHub Actions
GitLab CI and GitHub Actions solve the same problem with different vocabulary.
| GitLab CI | GitHub Actions |
|---|---|
stages and job order |
Jobs linked with needs |
include and templates |
Reusable workflows and composite actions |
rules and only/except |
on triggers and if conditions |
| CI/CD variables | Variables and secrets |
| Runners with tags | Runners with labels |
| Environments | Environments with protection rules |
GitHub Actions Importer can audit your GitLab pipelines and produce a first-draft conversion. Treat the output as a starting point. Custom scripts, cache keys and anything clever will need a person.
Run the old and new pipelines side by side on the same commits until the results match. Do not switch off a GitLab pipeline because the Actions version "looks right."
Step 4: Map people and permissions
- Match users by email so commit history still links to the right accounts.
- Translate GitLab groups to GitHub teams.
- Recreate branch protection: required reviews, required checks and who may push.
- Recreate secrets by hand in GitHub. Do not copy them through scripts that write to logs.
Step 5: Rehearse, then cut over in batches
Never migrate everything on one weekend.
- Pilot. Pick five to ten repositories from a friendly team. Migrate them fully, pipelines included, and fix what breaks.
- Batch. Group the rest by team. Each team gets a date and a short read-only window.
- Cut over. Make the GitLab project read-only, run a final mirror push, and switch deployments to the new pipelines.
- Redirect. Give developers one command:
git remote set-url origin [email protected]:acme/billing.git
- Keep a way back. Leave the GitLab projects archived and read-only for a few weeks. If something was missed, the source is still there.
The pitfalls that catch people
- Submodules still point at GitLab URLs.
- Hard-coded URLs hide in scripts, Dockerfiles and documentation.
- CI badges and status checks in READMEs break quietly.
- Deploy keys and webhooks do not move on their own.
- Scheduled pipelines are forgotten because nobody watches them.
- Container images stay in the GitLab registry unless you push them elsewhere.
A search across every repository for your GitLab hostname finds most of these in an afternoon.
How long it takes
A team of ten with twenty repositories can finish in a week. A few hundred repositories with real pipelines is a matter of weeks, mostly spent on CI conversion and scheduling teams. The inventory is what turns a guess into an estimate.
Want it done for you?
We run this process end to end as a GitLab to GitHub migration service. Send us your rough repository and pipeline counts and we will tell you what the pilot would look like.