是否将github页面添加到所有子文件夹?

时间:2020-07-18 07:54:01

标签: github github-pages

我在github中有一个存储库,它将所有我的Web开发任务都放在单独的子文件夹中,例如:

VishnuVelukutty / CourseraWebdevAssignment(主文件)/ module2-assignment(子文件夹)

所以master分支有gh页,我想将gh页独立添加到所有子文件夹(Assignment1,2,3 .....),以便当特定模块链接为已打开

是否可以将gh页应用于子文件夹?还是为每个模块创建独立的仓库?

我还没有启动.gitignore,静态站点,自述文件或主题,cobyismchrisjacob引用了这篇文章,但我没有使它起作用

这是我的github account to see if there any errors in setting up

git link

是供参考的图像

1 个答案:

答案 0 :(得分:0)

首先,确保创建一个gh-pages分支,并在其中添加至少一个提交并将其推送到您的GitHub存储库中。

然后,是的,您可以使用git submodulegh-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