我在github中有一个存储库,它将所有我的Web开发任务都放在单独的子文件夹中,例如:
VishnuVelukutty / CourseraWebdevAssignment(主文件)/ module2-assignment(子文件夹)
所以master分支有gh页,我想将gh页独立添加到所有子文件夹(Assignment1,2,3 .....),以便当特定模块链接为已打开
是否可以将gh页应用于子文件夹?还是为每个模块创建独立的仓库?
我还没有启动.gitignore,静态站点,自述文件或主题,cobyism和chrisjacob引用了这篇文章,但我没有使它起作用
是供参考的图像答案 0 :(得分:0)
首先,确保创建一个gh-pages
分支,并在其中添加至少一个提交并将其推送到您的GitHub存储库中。
然后,是的,您可以使用git submodule
在gh-pages
分支中将master
分支内容添加为当前存储库的子文件夹。 br />
(除非,如您此处所述,您chose the master
branch itself as source for GitHub Pages)
git checkout master
git submodule add -b gh-pages -- /remote/url/of/your/own/repo gh-pages
git commit -m "Add gh-pages branch as submodule"
git push
您将拥有一个gh-pages
子文件夹,您可以随时使用以下子文件夹进行更新:
git submodule update --remote