简体   繁体   English

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

[英]Adding github pages to all subfolders?

I have a repository in github which will house all of my web development assignments in separate sub-folders like:我在 github 中有一个存储库,它将我的所有 web 开发任务存放在单独的子文件夹中,例如:

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

So the master branch has gh-pages and I want to add the gh-page to all sub-folders (Assignment1,2,3.....) independently so that they work independently when the specific module-link is opened所以主分支有gh-pages,我想将gh-page独立添加到所有子文件夹(Assignment1,2,3.....),以便在打开特定模块链接时它们独立工作

Is it possible to apply gh-pages to a subfolder?是否可以将 gh-pages 应用于子文件夹? or do I have create independent repo for each module?或者我是否为每个模块创建了独立的仓库?

I have not initiated.gitignore, static site, readme nor theme and reffered to this post by cobyism and chrisjacob but i didn't get it working我没有启动.gitignore,static 站点,自述文件或主题,并由cobyismchrisjacob 引用了这篇文章,但我没有让它工作

Here is mygithub account to see if there any errors in setting up这是我的github账号,看看设置有没有错误

For reference of the images here is the git link此处的图像参考是git 链接

First, make sure to create a gh-pages branch, add at least one commit in it and push it to your GitHub repository.首先,确保创建一个gh-pages分支,在其中添加至少一个提交并将其推送到您的 GitHub 存储库。

Then , yes, you can add that gh-pages branch content as a subfolder of your current repository, in the master branch, using git submodule .然后,是的,您可以使用git submodulemaster分支中将该gh-pages分支内容添加为当前存储库的子文件夹。
(unless, as explained here, you chose the master branch itself as source for GitHub Pages ) (除非,如此处所述,您选择master分支本身作为 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

You will have a gh-pages subfolder, that you can update at any time with:您将拥有一个gh-pages子文件夹,您可以随时更新:

git submodule update --remote

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM