読み物Git · Collaboration

Level: Intermediate

GitHub vs GitLab vs Bitbucket vs Codeberg: Understanding Git Hosting Platforms

Every platform hosts the same Git repositories; they differ in review, permissions, automation, and control. A fair comparison of hosted and self-hosted options, and how to choose.

Edeeson Opina8 min read

An Intermediate lesson card: lesson 6 of the Git & Version Control series, GitHub vs GitLab vs Bitbucket vs Codeberg: Understanding Git Hosting Platforms, with the Miso fox at work.

What you’ll learn

  • Explain what hosting platforms add on top of Git
  • Compare GitHub, GitLab, Bitbucket, Azure Repos, Codeberg, and SourceHut
  • Weigh self-hosted Gitea, Forgejo, and GitLab against hosted services
  • Choose a platform by requirements, not familiarity
On this page
  1. Before you start
  2. What a hosting platform adds to Git
  3. Hosted platforms
  4. GitHub
  5. GitLab
  6. Bitbucket
  7. Azure Repos
  8. Codeberg
  9. SourceHut
  10. Self-hosted options
  11. The same feature, different names
  12. How to choose
  13. Common mistakes and troubleshooting
  14. Practical exercise: compare two platforms
  15. Key takeaways
  16. References
  17. What's next

Every Git hosting platform stores the same thing: ordinary Git repositories. What they sell, or give away, is everything around the repository: code review, permissions, issue tracking, automation, and where your data lives. This lesson compares the major hosted platforms (GitHub, GitLab, Bitbucket, Azure Repos, Codeberg, SourceHut) and the self-hosted options (GitLab self-managed, Gitea, Forgejo), explains which differences matter in practice, and gives you a way to choose that doesn't depend on which logo is most familiar.

Before you start

You should be able to clone, push, and pull from Working with Remote Repositories: Clone, Fetch, Pull, Push, and SSH, and remember from lesson 1 that Git and hosting platforms are different things. Product details and plans change often; this lesson describes how the platforms differ in kind, and leaves prices to each platform's current pages.

What a hosting platform adds to Git

Git itself gives you history, branches, and a way to exchange commits. A platform adds:

  • A shared, always-on remote with backups and access over SSH and HTTPS.
  • A web interface to browse code, history, and diffs.
  • Change review: pull requests or merge requests with comments, approvals, and status checks (lesson 7).
  • Access control: organizations, teams, roles, branch protection rules.
  • Issue tracking and project planning.
  • Automation: CI/CD pipelines triggered by pushes and reviews (lesson 11).
  • Package registries, wikis, release pages, and static site hosting, depending on the platform.

None of these features are part of Git, so they don't move automatically when you change platforms. That's the core of the vendor lock-in question in lesson 15.

Hosted platforms

GitHub

GitHub, owned by Microsoft since 2018, is the largest Git hosting service and the default home of a great many open-source projects. Collaboration happens through pull requests, Issues, Discussions, and Projects. Automation is GitHub Actions, with a large marketplace of reusable actions. GitHub also offers package registries, Codespaces (cloud development environments), and security features such as Dependabot and secret scanning. GitHub Enterprise Server is a self-hosted edition for organizations that need to run it themselves.

Strengths: the largest community, so contributors already have accounts; a very large ecosystem of integrations. Trade-offs: it's proprietary, and the deeper you use Actions and its other features, the more work a later move becomes.

GitLab

GitLab positions itself as a complete DevOps platform in one application. Review happens through merge requests; automation is built-in GitLab CI/CD, configured in a .gitlab-ci.yml file, with its own runners. GitLab is available as the hosted GitLab.com and as self-managed software you run on your own servers; its core is open source, with paid tiers adding features. Some features, such as pulling mirrors from other platforms, are limited to paid tiers.

Strengths: tightly integrated CI/CD, planning, and security tooling; a mature self-hosting option. Trade-offs: a large application to operate if you self-host, and some capabilities depend on the tier.

Bitbucket

Bitbucket, from Atlassian, integrates closely with Jira and Confluence. Bitbucket Cloud offers pull requests and Bitbucket Pipelines for CI/CD (bitbucket-pipelines.yml). For self-hosting, Atlassian offers Bitbucket Data Center; the older Bitbucket Server product reached end of support in February 2024, so organizations still running it should plan a move.

Strengths: a natural fit for teams already organized around Jira. Trade-offs: a smaller open-source community than GitHub or GitLab.

Azure Repos

Azure Repos is part of Microsoft's Azure DevOps suite, alongside Azure Boards (work tracking) and Azure Pipelines (CI/CD, configured in azure-pipelines.yml). It hosts Git repositories, plus Team Foundation Version Control for older projects. Azure DevOps Server is the self-hosted edition.

Strengths: deep integration with Azure and Microsoft identity; common in enterprises already using Microsoft tooling. Trade-offs: mostly used inside organizations rather than for public open-source work.

Codeberg

Codeberg is a non-profit, community-run platform operated by Codeberg e.V., a registered association in Berlin, Germany. It runs Forgejo, so its features match Forgejo's: pull requests, issues, wikis, releases, and package registries. It focuses on free and open-source projects; check its terms of use before hosting a private or proprietary project there.

Strengths: run by a non-profit, built on free software, no advertising or data monetization. Trade-offs: a smaller community and fewer integrations; CI capacity is more limited than on large commercial platforms.

SourceHut

SourceHut takes a deliberately different path: lightweight pages that work without JavaScript, and collaboration through email. Contributors send patches with git send-email to a mailing list, the way projects such as the Linux kernel and Git itself work, rather than opening pull requests in a web interface. It includes a build service, builds.sr.ht.

Strengths: simple, fast, and free software; fits email-based workflows. Trade-offs: unfamiliar to contributors used to pull requests.

Self-hosted options

Running your own platform gives you control over data location, access, and upgrades, at the cost of operating it: updates, backups, security patches, and availability are your job.

  • GitLab self-managed: the most complete self-hosted platform, and the heaviest to run.
  • Gitea: a lightweight, open-source forge written in Go that runs comfortably on small servers. It includes Gitea Actions, which resembles GitHub Actions.
  • Forgejo: a community-governed fork of Gitea, created in 2022 after concerns about Gitea's governance, and now developed independently. It includes Forgejo Actions. Forgejo's documentation is explicit that Forgejo Actions is designed to be *familiar* to GitHub Actions users but is *not designed to be compatible*: for example, the default runner image is a small Debian image rather than GitHub's large Ubuntu one, some keys in the github context are missing, and some job settings such as permissions are ignored. Expect to adjust workflows when moving them.
  • GitHub Enterprise Server, Bitbucket Data Center, and Azure DevOps Server: self-hosted editions of the commercial platforms, usually licensed per user.

The same feature, different names

Platforms often name the same concept differently, which confuses people moving between them:

Text
Concept                 GitHub              GitLab               Bitbucket           Azure Repos       Forgejo / Gitea
Change review           Pull request        Merge request        Pull request        Pull request      Pull request
CI/CD                   GitHub Actions      GitLab CI/CD         Pipelines           Azure Pipelines   Forgejo / Gitea Actions
CI config file          .github/workflows/  .gitlab-ci.yml       bitbucket-          azure-            .forgejo/workflows/
                        *.yml                                    pipelines.yml       pipelines.yml     (Gitea: .gitea/workflows/)
Grouping                Organization        Group                Workspace           Project           Organization
Protected branches      Rulesets, branch    Protected branches   Branch              Branch policies   Protected branches
                        protection                               restrictions

The Git concepts underneath (branches, commits, merges) are identical everywhere.

How to choose

Ask these questions, roughly in order:

  1. Where are your collaborators? For an open-source project that wants outside contributors, the platform where they already have accounts lowers the barrier. For a private team, this matters less.
  2. Where must your data live, and who may operate it? Legal, contractual, or security requirements may rule out hosted services or require a specific region. Self-hosting or a dedicated instance answers that.
  3. What do you need around the code? Integrated CI/CD, issue tracking that fits your process, package registries, and identity integration (single sign-on).
  4. Who will operate it? Self-hosting needs someone responsible for updates, backups, and security.
  5. How hard would leaving be? Prefer portable practices: CI steps in scripts that any runner can call, documentation in the repository, and regular exports (lesson 15).
  6. What does it cost, now and as you grow? Check current plans; pricing and free-tier limits change.

There's rarely one right answer. A solo developer might keep personal projects on Codeberg, contribute to open source on GitHub, and work on a client's self-managed GitLab, all with the same Git skills.

Common mistakes and troubleshooting

  • Choosing by familiarity alone. Compare requirements: data location, review flow, CI, cost, and exit plan.
  • Assuming CI configuration is portable. Each platform's syntax and runners differ, even when they look alike. Keep logic in scripts.
  • Forgetting what doesn't move with the repository. Issues, reviews, wikis, CI settings, and permissions are platform data.
  • Self-hosting without an owner. An unpatched forge is a security risk. Plan updates and backups first.
  • Using an end-of-support product. Check the support status of self-hosted editions you run.
  • Hosting proprietary code where the terms don't allow it. Read the terms of community platforms.

If a team disagrees about platforms, list the features you actually use today, and check which platform-specific features you'd have to replace. The list is usually shorter than expected, which makes the decision easier.

Practical exercise: compare two platforms

Pick two platforms, ideally one hosted and one self-hostable:

  1. Create a test repository on each (or use a local Forgejo or Gitea instance in a container).
  2. Push the same small project to both, using SSH.
  3. On each, open a pull or merge request from a feature branch and leave a review comment.
  4. Find where branch protection is configured, and require a review before merging.
  5. Write a short CI workflow that runs one command, such as printing the Git version, on each. Note what you had to change between them.
  6. Write five lines comparing them on the questions above, and note what wouldn't move if you switched.

Key takeaways

  • All platforms host ordinary Git repositories; they differ in review, permissions, automation, planning, and data control.
  • GitHub has the largest community; GitLab integrates DevOps tooling; Bitbucket fits Jira teams; Azure Repos fits Microsoft-centric organizations; Codeberg is non-profit and Forgejo-based; SourceHut uses email workflows.
  • Gitea and Forgejo are lightweight self-hosted forges; Forgejo Actions is familiar to, but not compatible with, GitHub Actions.
  • Choose by collaborators, data requirements, needed features, operational capacity, exit cost, and price.

References

What's next

Platforms differ most in how they handle review. Pull Requests, Merge Requests, Code Reviews, and Team Collaboration covers how to propose changes, review them well, and collaborate across platforms.

See every lesson in Git & Version Control: From Fundamentals to Advanced Workflows