Gentoo on Codeberg
Summary
Gentoo now mirrors its repositories on Codeberg (codeberg.org/gentoo/gentoo), moving away from GitHub. Contributions are welcome using the AGit approach for pull requests.
Gentoo expands to Codeberg mirrors
Gentoo Linux launched a new mirror on Codeberg this week to provide developers with a community-focused alternative to GitHub. The move allows contributors to submit pull requests for the primary Gentoo repository at a new Berlin-based home. This transition represents the first major step in a broader plan to migrate the project's secondary infrastructure away from Microsoft-owned services.
The project maintainers confirmed that other Git repositories within the Gentoo organization will follow this move shortly. Developers can currently access the mirror at codeberg.org/gentoo/gentoo to begin contributing. This change fulfills a goal established in the 2025 end-of-year review, where the Gentoo team signaled a desire for more independent hosting options.
Gentoo remains one of the oldest and most flexible Linux distributions in existence. Its users compile software from source using the Portage package manager, which requires a highly stable and accessible repository system. By adding Codeberg to its list of mirrors, Gentoo ensures that its source code remains available even if access to other commercial platforms is interrupted.
Moving away from GitHub infrastructure
The decision to mirror on Codeberg signals a growing trend among open-source projects to diversify their hosting. While GitHub currently hosts the majority of the world’s open-source code, its proprietary nature and corporate ownership have pushed some communities toward FOSS-only platforms. Gentoo developers are prioritizing platforms that align with the distribution's commitment to software freedom.
Gentoo is not deleting its GitHub mirror immediately, but the project is actively encouraging a shift in traffic. The migration is a gradual process designed to test the scalability of alternative forges under the load of a major Linux distribution. Codeberg offers a environment that lacks the tracking and corporate overhead associated with larger Silicon Valley competitors.
The move also addresses concerns regarding software supply chain security. By spreading mirrors across different jurisdictions and hosting providers, Gentoo reduces the risk of a single point of failure. The project maintainers noted that this migration is about providing choice to the community rather than strictly enforcing a single platform.
The benefits of Berlin based hosting
Codeberg operates as a non-profit organization registered in Germany, which offers different legal protections for data and code compared to US-based entities. The platform runs on Forgejo, a community-governed fork of Gitea that emphasizes transparency and user control. This technical foundation makes it a natural fit for a project like Gentoo that values manual configuration and granular control.
Because Codeberg is member-funded, it does not rely on advertising or data mining to sustain its operations. This financial model appeals to the Linux community, which has grown increasingly wary of "free" services provided by massive tech conglomerates. The platform’s infrastructure is optimized for performance and privacy, avoiding the heavy JavaScript trackers found on mainstream code forges.
The Gentoo team highlighted the following advantages of using the new Codeberg mirror:
- Data Sovereignty: Hosting in Germany ensures compliance with strict European privacy standards.
- Non-Profit Governance: The platform is managed by the community, not shareholders.
- Open Source Stack: Every part of the Codeberg forge is itself open-source software.
- Reduced Centralization: Moving traffic away from GitHub helps decentralize the global Git ecosystem.
Streamlining contributions with AGit technology
Gentoo is recommending a specific workflow for contributors who choose the Codeberg mirror. Instead of the traditional "fork and pull" model, the project suggests using the AGit approach. This method is more space-efficient because it does not require every contributor to maintain a full copy of the massive Gentoo repository on their personal profile.
The AGit protocol allows developers to push changes directly to the upstream mirror using a specific Git reference. The platform then automatically generates a pull request from that push. This reduces the storage burden on Codeberg’s servers and simplifies the local workflow for the developer. It is a faster way to get code into the main tree without the clutter of abandoned forks.
To use this workflow, contributors follow a specific set of commands:
- Clone the upstream repository: git clone git@git.gentoo.org:repo/gentoo.git
- Add the Codeberg remote: git remote add codeberg ssh://git@codeberg.org/gentoo/gentoo
- Push the changes: git push codeberg HEAD:refs/for/master -o topic="your-fix-name"
If a contributor needs to update their submission, they simply run the same push command again. The system recognizes the topic flag and updates the existing pull request. To force-push an update after amending commits, developers must add the -o force-push=true option to their command string.
Gentoo maintains its own primary servers
Despite the new presence on Codeberg, Gentoo will continue to host its own primary repositories. The site at git.gentoo.org remains the definitive source of truth for all Portage tree data and project code. Codeberg and GitHub function strictly as mirrors to facilitate easier public contribution and provide redundancy.
This "self-hosted first" philosophy is a core tenet of Gentoo’s infrastructure management. The project maintains its own hardware and network services to ensure that no third-party company can dictate the terms of its software distribution. Mirrors are a convenience for the public, but the project’s heart remains on its own iron.
The Gentoo infrastructure team thanked the volunteers who managed the technical hurdles of the Codeberg setup. Moving a repository with the size and history of Gentoo requires significant coordination to ensure commit hashes remain consistent across all platforms. The project expects to move more of its internal tooling and secondary repositories to the Gentoo Codeberg organization throughout the remainder of 2025.
Developers who want more technical details on the transition can visit the Gentoo Wiki. The documentation includes expanded guides for setting up SSH keys and managing multiple remotes. The team encourages all regular contributors to test the Codeberg workflow and provide feedback on the experience.
Related Articles
Gentoo dumps GitHub over Copilot nagware
Gentoo is migrating from GitHub to Codeberg, citing "continuous attempts to force Copilot usage" and concerns over AI-generated code quality and ethics.
10 Hacks for Hanging Pictures Perfectly Every Time
Use hacks like a ball as a level, painter's tape for spacing, toothpaste to mark spots, or a fork to guide wire for perfectly hung pictures.
Stay in the loop
Get the best AI-curated news delivered to your inbox. No spam, unsubscribe anytime.
