Skip to main content

将子模块用于 GitHub Pages

您可以将子模块用于 GitHub Pages 以在站点代码中包含其他项目。

谁可以使用此功能?

GitHub Pages 适用于具有 GitHub Free 和组织的 GitHub Free 的公共存储库,以及具有 GitHub Pro、GitHub Team、GitHub Enterprise Cloud 和 GitHub Enterprise Server 的公共和专用存储库。 有关详细信息,请参阅“GitHub 的计划”。

如果 GitHub Pages 站点的仓库包含子模块,则在构建站点时会自动拉取其内容。

只能使用指向公共仓库的子模块,因为 GitHub Pages 服务器无法访问私有仓库。

对子模块(包括嵌套子模块)使用 https:// 只读 URL。 你可以在 .gitmodules 文件中进行此更改。

延伸阅读