About READMEs
You can add a README file to a repository to communicate important information about your project. A README, along with a repository license and contribution guidelines, communicates expectations for your project and helps you manage contributions.
For more information about providing guidelines for your project, see "Setting up your project for healthy contributions."
A README is often the first item a visitor will see when visiting your repository. README files typically include information on:
- What the project does
- Why the project is useful
- How users can get started with the project
- Where users can get help with your project
- Who maintains and contributes to the project
If you put your README file in your repository's hidden .github
, root, or docs
directory, GitHub Enterprise Server will recognize and automatically surface your README to repository visitors.
If a repository contains more than one README file, then the file shown is chosen from locations in the following order: the .github
directory, then the repository's root directory, and finally the docs
directory.
如果将 README 文件添� 到与用户名同名的公共仓库的� �目录,则该 README 将自动显示在您的个人资料页面上。 您可以使用 GitHub Flavored Markdown 编辑您的个人资料以在您的个人资料 README,以在您的个人资料上创建个性化的区域。 有关详细信息,请参阅“管理个人资料 README”。
Auto-generated table of contents for README files
For the rendered view of any Markdown file in a repository, including README files, GitHub Enterprise Server will automatically generate a table of contents based on section headings. You can view the table of contents for a README file by clicking the menu icon at the top left of the rendered page.
Section links in README files and blob pages
您可以直接链接到渲染文件中的某个部分,方法是将� � �悬停在该部分� �题上以显示链接:
Relative links and image paths in README files
您可以在渲染的文件中定义相对链接和图像路径,以帮助读者导航到仓库中的其他文件。
相对链接是相对于当前文件的链接。 例如,如果在仓库� �目录下有一个自述文件,而在 docs/CONTRIBUTING.md 中有另一个文件,则自述文件中的 CONTRIBUTING.md 的相关链接如下所示 :
[Contribution guidelines for this project](docs/CONTRIBUTING.md)
GitHub Enterprise Server 将� �据您当前使用的分支自动转换相对链接或图像路径,从而使链接或路径始终有效。 链接的路径将相对于当前文件。 以 /
开头的链接将相对于存储库� �目录。 可使用所有相对链接操作数,例如 ./
和 ../
。
相对链接更便于用户克隆仓库。 绝对链接可能� 法用于仓库的克隆 - 建议使用相对链接引用仓库中的其他文件。
Wikis
A README should contain only the necessary information for developers to get started using and contributing to your project. Longer documentation is best suited for wikis. For more information, see "About wikis."