In a statement, the Gentoo leadership said some unknown individuals had gained control of the GitHub Gentoo mirror on 28 June at 20.20 UTC and modified the content and pages.
Gentoo is a Linux distribution meant for advanced users. The source is compiled locally depending on user preferences and is often optimised for specific hardware.
Some larger packages are offered as precompiled binaries with the same applying to those which have no source code available.
The Gentoo project said: "We are still working to determine the exact extent and to regain control of the mirror and its repositories. All Gentoo code hosted on GitHub should, for the moment, be considered compromised."
The project said that this did not affect any code hosted on the Gentoo infrastructure. "Since the master Gentoo ebuild repository is hosted on our own infrastructure and since GitHub is only a mirror for it, you are fine as long as you are using rsync or webrsync from gentoo.org.
"Also, the gentoo-mirror repositories including metadata are hosted under a separate Github mirror and likely not affected as well. All Gentoo commits are signed, and you should verify the integrity of the signatures when using git."