如何从项目的文档创建Github页面? [英] How to create Github pages from a project's documentation?
问题描述
我在Github上有一个项目,其中包含一些包含一些自动生成的HTML文档的目录。我想在Github的项目页面设施中使用该文档。
I have a project on Github that has a directory containing some automatically generated HTML documentation. I would like to use that documentation within Github's project pages facility.
所以,我已经阅读了关于如何创建项目的gh页面根分支。这有效地创建一个空的分支。
So, I've read the instructions on how to create the project's gh-pages root branch. This effectively creates an empty branch.
我想要的帮助是镜像 / docs
路径从 master
分支,所以它们在 gh页面
分支的根目录。接近这个的最好方法是什么?
What I'd like help with is mirroring the html files in the /docs
path from the master
branch, so they are in the root of the gh-pages
branch. What is the best way of approaching this?
推荐答案
在这里回答我自己的问题已经用Git子模块
Answering my own question here... have achieved what I wanted with Git submodules.
我基本上复制了什么是详细说明了这一点,但总而言之:
I basically copied what's detailed in this sake task, but in summary:
- 移动
docs
路径进入临时文件夹。提交更改。 - 根据 gh-pages 分支。 com /#project_pagesrel =noreferrer>常规说明
- 将临时文件夹中的所有内容移动到新的
gh页面
分支。提交更改。 - 返回主分支,将
中的远程
文件夹。gh-pages
添加为子模块文件 - 提交更改。 Voila!
- Moved the
docs
path into a temp folder. Commit changes. - Created a clean
gh-pages
branch as per the usual instructions - Moved everything from the temp folder into the new
gh-pages
branch. Commit changes. - Back in the master branch, add the remote
gh-pages
as a submodule in thedocs
folder. - Commit changes. Voila!
这篇关于如何从项目的文档创建Github页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!