要包含在gh页面中的特定文件

时间:2014-12-26 20:00:26

标签: git github configuration github-pages

场景:由于项目目前存在,mastergh-pages完全分开(gh-pages作为孤儿而开始,并不与{{{\ n}共享任何代码1}})。 master分支已经发展为包含运行客户端模拟的JavaScript代码。


此时,将模拟代码移动到gh-pages(它现在是项目的一个功能,单元测试,中心位置等)是有意义的。

如何在master中自动将某些文件master推送到指定位置

或者,更一般地说,您将如何管理这种情况?

1 个答案:

答案 0 :(得分:0)

如“Sharing files across branches in Git”中所述,您可以考虑在自己的git repo中隔离该组javascript代码(及其单元测试)。

这样您就可以在master分支和主回购的gh-branch中引用该回购:


2016年8月更新: Simpler GitHub Pages publishing 现在允许将您的网页文件保存在相同分支的子文件夹中(不再需要gh-pages) :

Now you can select a source in your repository settings and GitHub Pages will look for your content there.

相关问题