我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们

配置 GitHub Pages 站点的发布源

如果您使用 GitHub Pages 站点的默认发布源,您的站点将自动发布。 You can also choose to publish your site from a different branch or folder.

People with admin or maintainer permissions for a repository can configure a publishing source for a GitHub Pages site.

GitHub Pages 适用于具有 GitHub Free 和组织的 GitHub Free 的公共仓库,以及具有 GitHub Pro、GitHub Team、GitHub Enterprise Cloud 和 GitHub Enterprise Server 的公共和私有仓库。 更多信息请参阅“GitHub 的产品”。

本文内容

Did this doc help you?

有关发布源的更多信息,请参阅“关于 GitHub Pages”。

选择发布源

Before you configure a publishing source, make sure the branch you want to use as your publishing source already exists in your repository.

  1. 在 GitHub 上,导航到站点的仓库。

  2. 在仓库名称下,单击 Settings(设置)

    仓库设置按钮

  3. Under "GitHub Pages", use the None or Branch drop-down menu and select a publishing source.

    Drop-down menu to select a publishing source

  4. Optionally, use the drop-down menu to select a folder for your publishing source.

    Drop-down menu to select a folder for publishing source

  5. 单击 Save(保存)

    Button to save changes to publishing source settings

GitHub Pages 站点发布问题疑难排解

Note: If your site has not published automatically, make sure someone with admin permissions and a verified email address has pushed to the publishing source.

If you choose the docs folder on any branch as your publishing source, then later remove the /docs folder from that branch in your repository, your site won't build and you'll get a page build error message for a missing /docs folder. 更多信息请参阅“关于 GitHub Pages 站点的 Jekyll 构建错误疑难排解”。 更多信息请参阅“关于 GitHub Pages 站点的 Jekyll 构建错误疑难排解”。

Did this doc help you?