GitHub Alternatives: Hosted Git, Self-Hosting and Migration

Compare GitLab, Gitea, Forgejo, Codeberg and SourceHut. Learn what a Git mirror moves, what it leaves behind and how to plan a repository migration.

•4 min read•Code Editors, IDEs & Playgrounds

Editorial illustration: GitHub Alternatives: Hosted Git, Self-Hosting and Migration

Verdict:Use GitLab when you want hosted Git with integrated CI and can work within its hosted Free limits. Evaluate Gitea or Forgejo when control of the server justifies operating backups, updates and runners. Codeberg fits eligible Free Software projects. A Git mirror transfers repository history, branches and tags; issues, review discussions, CI credentials and access rules require a separate migration plan.

Quick comparison

ToolPricePlatformsBest forTested
GitLabHosted Free: five users per top-level group; 400 compute minutes/month—Hosted Git and CI in one serviceDocs only
GiteaMIT-licensed self-hosted software; infrastructure extra—A forge on your own infrastructureDocs only
ForgejoFree self-hosted forge; infrastructure extra—A community-led self-hosting optionDocs only
CodebergCommunity-hosted Free Software projects; check eligibility—Eligible open-source projectsDocs only
SourceHutSubscription tiers $4, $8 or $12/month; alpha service rules vary—Teams willing to adopt a different contribution workflowDocs only

Independent comparison. Paid placements are labelled separately; editorial links earn no affiliate commissions. Learn more.

Good fit if

  • Developers evaluating hosted or self-hosted Git beyond GitHub
  • Maintainers who need a repository and workflow migration checklist
  • Small teams separating hosted service limits from self-managed software

Not ideal if

  • Buyers seeking verified provider-specific AI training or legal assurances
  • Teams expecting a mirror push to migrate every GitHub collaboration feature

The right GitHub alternative depends on what you are replacing: a remote Git repository, a collaboration platform, a CI service, or the organisation that operates the hosting. Those are different decisions. Moving commits is relatively contained; moving reviews, build credentials and contributor habits is a project of its own.

For hosted Git with integrated CI, start by evaluating GitLab. For a forge on infrastructure you control, compare Gitea and Forgejo. For an eligible Free Software project, consider Codeberg. SourceHut belongs on the list if its contribution workflow fits your maintainers. These are recommendations based on documented capabilities, not results from running the servers.

GitHub alternatives by hosting responsibility

OptionWho operates the forge?Documented starting pointMain decision
GitLab.comGitLabFree: five users per top-level group, 400 compute minutes/month, 10 GiB storageCheck group size and runner requirements
GiteaYou, for the self-hosted productMIT-licensed software with Git, reviews, issues, packages and CI featuresWho owns updates and recovery?
ForgejoYouA self-hosted Free Software forgeCheck integrations and your preferred project governance
CodebergA nonprofit community serviceForgejo-powered hosting focused on Free SoftwareCheck project eligibility and service rules
SourceHutSourceHut, for the hosted serviceSubscription tiers of $4, $8 or $12/month with the same featuresCheck workflow fit and alpha payment rules

Sources: GitLab, Gitea, Forgejo, Codeberg and SourceHut, checked October 26, 2026. GitLab.com's hosted Free limits are not a description of every self-managed GitLab installation.

SourceHut's pricing needs a careful reading: during its public alpha, payment is optional for most services but required for builds and chat. People contributing to a hosted project are not all required to buy subscriptions. Do not multiply a subscription figure by every occasional contributor without checking the service's actual rules.

Choose a platform around the work after git push

For a small commercial team, count the people in your top-level GitLab group before relying on its hosted Free plan. Then inventory build minutes, artifact storage and any deployment integrations. A plan can be free for repository hosting and still fail your CI budget.

Gitea and Forgejo make the operating boundary explicit: you choose the machine and storage, and you own recovery when they fail. That suits a team with an operator and a reason to control hosting. It is less attractive when nobody is responsible for restoring a deleted repository, applying updates or rotating runner credentials. Free software does not remove those jobs.

Codeberg is a community service with a Free Software mission. It should not be presented as unrestricted, no-cost storage for proprietary company repositories. Read the service's current terms for your project before treating it as a destination.

If your reason for leaving GitHub is an AI or data-use policy, read each destination's current terms separately. A license on forge software does not establish how a hosted provider uses data, and moving to another brand does not itself establish a different policy. This article makes no provider-specific AI training guarantee.

For a closer comparison of the integrated platform, read GitLab alternatives. The free Git client guide addresses desktop clients rather than repository hosting, so changing clients should be evaluated separately from moving a forge.

What a Git mirror does and does not move

GitHub's repository duplication guide describes a bare clone followed by a mirror push. This preserves repository refs, including branches and tags. Repositories using Git LFS require separate LFS fetch and push steps.

Migration itemTreat it as
Commits, branches and tagsGit repository data
LFS objectsA separate transfer and verification task
Issues, pull-request conversations and review decisionsPlatform data requiring an importer or archive
Actions workflows and runner configurationCI code requiring destination-specific validation
Secrets, deploy keys and registry credentialsCredentials to recreate and rotate deliberately
Branch protection, team permissions and webhooksPolicies to rebuild and test

A repository that clones successfully is only the first acceptance check. A release engineer must still be able to publish, a contributor must still be able to open a review, and a restricted account must still be denied access.

A migration pilot with a clear rollback point

Start with a low-risk repository that resembles your real workflow. Record the source's branches, tags, LFS use, branch rules, integrations and latest successful release. Create an empty destination repository before using a mirror push: mirror operations can overwrite destination refs, so do not aim them at a repository containing work you need.

  1. Transfer Git history and LFS data using the destination's supported process. Compare expected refs and test a clean clone from a second environment.
  2. Check whether an importer supports your issues and reviews. If it does not, keep an accessible archive with links from the new project.
  3. Rebuild CI with new credentials. Validate a pull request, a protected-branch merge and a release job; confirm which system is allowed to deploy.
  4. Recreate permissions and webhooks. Test with a maintainer account and a restricted account rather than relying on the administrator view.
  5. Set a cutover window. Freeze writes on the old forge, reconcile final changes, update remotes and document how to restore service if acceptance fails.

Avoid two writable copies without a reconciliation plan. They can diverge while both appear healthy. Preserve the original repository until the destination's recovery, permissions and release path have been checked.

When staying on GitHub costs less

Keep GitHub if external contributions, Actions integrations and release tooling are the work you would spend weeks rebuilding without a clear gain. Choose GitHub alternatives when the hosting requirement, cost model or operating control is concrete enough to justify that work. A good migration ends with a functioning contribution and release process, not just a new remote URL.

Limits of this review

Official documentation review on October 26, 2026. No server deployment, CI compatibility benchmark or migration test was performed. Hosted and self-managed offers are compared separately.

FAQ

Does git push --mirror copy GitHub issues and pull requests?

No. It copies Git refs to the destination. Issues, review discussions, permissions, workflow credentials and other platform data need a compatible importer or a separate archive.

Is self-hosted Git free?

The software may be free to use, but the server, storage, backups, updates, monitoring and CI runners still require resources and operator time.

Can a private company use Codeberg as a free GitHub replacement?

Codeberg focuses on Free Software and community projects. Review its current terms and eligibility before moving proprietary or private company work; do not assume it is unrestricted free corporate hosting.

Related guides

More in Code Editors, IDEs & Playgrounds

All Code Editors, IDEs & Playgrounds alternatives →

Sources

Kevin Fan

Kevin Fan is a SaaS founder. He runs Free Instead Of, which tracks free and open-source alternatives to paid software and checks prices and plan limits against vendor documentation.

Methodology

Official documentation review on October 26, 2026. No server deployment, CI compatibility benchmark or migration test was performed. Hosted and self-managed offers are compared separately.

Share: