Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
828 views
in Technique[技术] by (71.8m points)

git - Copying Doxygen Documentation from gh-pages branch into a subfolder of Master branch

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.

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.

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

 git submodule update --remote

You can declare a branch content as submodule of another branch

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

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).


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

That would simplify your issue.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...