About publishing sources
Your GitHub Pages site will publish whenever changes are pushed to a specific branch. You can specify which branch and folder to use as your publishing source. The source branch can be any branch in your repository, and the source folder can either be the root of the repository (/
) on the source branch or a /docs
folder on the source branch. Whenever changes are pushed to the source branch, the changes in the source folder will be published to your GitHub Pages site.
警告:如果您的站点管理员启用了公共页面, 则 GitHub Pages 站点在互联网上公开可用,即使站点的存储库是私有的或内部的。 如果站点的仓库中有敏感数据,您可能想要在发布前删除它。 更多信息请参阅“为企业配置 GitHub Pages”和“关于存储库”。
Publishing from a branch
-
Make sure the branch you want to use as your publishing source already exists in your repository.
-
在 GitHub Enterprise Server 上,导航到站点的仓库。
-
在仓库名称下,单击 Settings(设置)。
-
在左侧边栏中,单击 Pages(页面)。
-
在“GitHub Pages”下,使用 None(无)或 Branch(分支)下拉菜单选择发布源。
-
(可选)使用下拉菜单选择发布源的文件夹。
-
单击 Save(保存)。
Troubleshooting publishing from a branch
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.
如果选择任意分支上的 docs
文件夹作为发布源,然后从仓库的该分支中删除了 /docs
文件夹,则您的站点将不会构建,并且您将收到提示缺失 /docs
文件夹的页面构建错误。 更多信息请参阅“关于 GitHub Pages 站点的 Jekyll 构建错误疑难排解”。