将 Doxygen 文档从 gh-pages 分支复制到 Master 分支的子文件夹中 [英] Copying Doxygen Documentation from gh-pages branch into a subfolder of Master branch

查看:51
本文介绍了将 Doxygen 文档从 gh-pages 分支复制到 Master 分支的子文件夹中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我有一个 Travis 构建,它生成 Doxygen 文档,然后将其上传到我的 GitHub 上的 gh-pages 分支.我们还有一个网站目前是从 master 分支而不是 gh-pages 构建的.

Currently I have a Travis build that generates Doxygen documentation and then uploads this into a gh-pages branch on my GitHub. We also have a website that is currently being built from the master branch not gh-pages.

我想要的是在 Travis 构建通过后运行的脚本,该脚本将文件从 gh-pages 分支复制到我们在 master 从中我们可以调整网站以链接到文档.

What I would like is a script to run after the Travis build passes that copies over the files from the gh-pages branch into a subfolder of our web files in master from which we can adjust the website to link to the documentation.

这是可能的还是从一开始就将文档上传到 master 会更容易?

Is this possible or would it be easier to simply upload the documentation into master from the start?

推荐答案

您可以按原样继续(上传 gh-branch 中的文档),但添加一个步骤:

You can go on as is (upload the documentation in the gh-branch), but add one more step:

 git submodule update --remote

您可以将一个分支内容声明为另一个分支的子模块

git checkout master
git rm -r gh-pages # save your data first
git submodule add -b gh-pages -- /remote/url/of/your/own/repo
git commit -m "ADd gh-pages branch as submodule"
git push

由于子模块将遵循其自己分支的最新提交,因此git submodule update --remotemaster 中完成就足以更新 gh-pages 子文件夹(子模块的根目录)的内容.

Since that submodule will follow the latest commit of its own branch, a git submodule update --remote done in master will be enough to update the content of the gh-pages subfolder (root directory of the submodule).

注意:自 2016 年 8 月起,您可以正确发布页面来自 master 分支(并不总是 gh-pages 分支)

Note: Since August 2016, you can publish your pages right from the master branch (not always the gh-pages branch)

这会简化您的问题.

这篇关于将 Doxygen 文档从 gh-pages 分支复制到 Master 分支的子文件夹中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆