Fix README.md precedence logic for repository home pages #163997
Replies: 5 comments
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
Noticed this behavior as well, was very surprised and annoyed. |
Beta Was this translation helpful? Give feedback.
-
|
I discovered this and I'm surprised too. It is a nobrainer. |
Beta Was this translation helpful? Give feedback.
-
|
I had to rename |
Beta Was this translation helpful? Give feedback.
-
|
Same thing here, I have to rename the .github/README.md file to .github/github-README.md to avoid this issue. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Bug
Body
Proposal: Fix README.md Precedence: Root README Must Always Take Priority Over
/.github/README.mdThe current GitHub behavior allows
/.github/README.mdto override the root-level/README.mdfor the repository homepage if both are present.To be clear: this is not a feature, this is a bug.
This causes confusion, violates user expectations, and contradicts established scoping and best practices in software engineering and security. The
/.github/README.mdshould at most only serve as a fallback if the root README is missing. Not an override.Problem Statement
When both
/README.mdand/.github/README.mdexist, GitHub displays the/.github/README.mdby default as the repository homepage. This behavior has several issues, besides just making literally no sense.Root README.md is Canonical:
Developers, contributors, and official documentation expect
/README.mdto be the primary entry point for project documentation./.github/README.mdis intended as a fallback for cases where the root README is missing, not as a mechanism for overriding it.Scoping Principles Violated:
In all well-established programming and configuration paradigms, a child or nested scope (like
/.github/) should not override its parent (the repo root). Allowing a nested README to override the parent increases the risk of confusion, accidental misconfiguration, and security issues by expanding the policy/configuration surface.Unintended Conflicts:
The
/.github/directory is now also used by tools (e.g., Copilot, VSCode extensions) to store agentic workflow prompts and AI configuration files. This increases the risk of accidental README conflicts or override scenarios.Best Practices and Documentation:
Official documentation and conventions state that files such as
/README.md,/LICENSE, and/CONTRIBUTING.mdshould reside at the repository root for maximum visibility and compliance. Allowing/.github/README.mdto take precedence undermines this guidance.Example: Google Chromium Repo
Take Google's high-profile
chromium/chromiumrepository, one of the world's most visible open source projects, as a practical demonstration of how the current flawed precedence logic negatively impacts usability and accessibility:/.github/README.mdin this repo is specific to AI prompting workflows and agentic instructions./README.md, but is effectively hidden because GitHub displays the/.github/README.mdby default when visiting the repository.Proposed Solution
/README.mdexists, it should always be used as the primary documentation visible at the repository root in the GitHub UI./.github/README.mdshould only serve as a fallback if the root README is missing, and that itself is debatable even./.githubprofile README can remain as-is./.github/README.mdis only a fallback...even though this should go without saying as the default expected behavior.Rationale
/README.mdat the repo root to be the canonical documentation./.github/for AI prompts and configs, accidental overrides are becoming more common and confusing../github/OWNERS(which is specific to the contents of that hidden directory) received higher precedence than the repo's root/OWNERS(which is an entirely different list altogether in the chromium repo) somewhere in the GitHub repository interface?Related Observations & Precedents
This behavior appears to be a bleed-over from the custom precedence handling used for the special repository
octocat/.github, where/.github/README.mdis intentionally surfaced. Unfortunately, this special-case logic is being incorrectly applied to nested/.githubfolders in normal repositories, causing confusion and unexpected overrides.The
/.github/profile/README.mdis already handled with separate logic, other special files (e.g.,CONTRIBUTING.md) do not override root files, only provide them if missing.Given how deeply integrated filename-based UI logic is in GitHub.com, this should be possible with minimal (if any) breaking changes or risk of regression.
Beta Was this translation helpful? Give feedback.
All reactions