How to migrate from GitHub to Forgejo

How to migrate from GitHub to Forgejo (without losing your mind)

The good news first: Git is Git. GitHub didn't invent it and doesn't own it, which means moving your code elsewhere is fundamentally a git push away. This guide walks through migrating to gitbuild.dev — EU-hosted Git powered by Forgejo — covering code, issues, and pull requests.

Step 1: Create your account

Register and verify your email. A Forgejo workspace is provisioned automatically — no setup, no server, no configuration.

Step 2: Move the code

Two options, depending on the repository.

Option A — change the remote (fastest, code only):

git remote set-url origin https://git.gitbuild.dev/you/your-app.git
git push -u origin main

Push any other branches and tags you want to keep:

git push origin --all
git push origin --tags

Option B — Forgejo's built-in migration (code + metadata):

In the Forgejo interface, choose New Migration, paste the GitHub repository URL, and authenticate with a GitHub token. Forgejo imports the repository along with issues, pull requests, labels, milestones, and releases. For anything beyond a bare code move, this is the option you want.

Step 3: Redirect your collaborators

Update the remotes on every machine and CI system that pushes to the old repository:

git remote set-url origin https://git.gitbuild.dev/you/your-app.git

If you keep the GitHub repository around during a transition period, set it to a mirror push or archive it with a README pointer to the new home. Don't leave two writable copies — diverging history is the one way this migration actually goes wrong.

Step 4: Webhooks and integrations

Recreate any webhooks in the repository settings on Forgejo. Most services that integrate via a Git remote or a plain webhook (deployment targets, status bots) work unchanged.

What you get for the trouble

  • Your code hosted in the European Union, under EU law — not a US cloud region
  • No AI training on your repositories — contractual, not a toggle
  • An open-source platform with no lock-in: export or move to any other Forgejo instance whenever you like

The full feature comparison is on our GitHub alternative page, and plans start at free — see pricing.