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 :
VishnuVelukutty/ CourseraWebdevAssignment (master)/ module2-assignment (subfolder)
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
Is it possible to apply gh-pages to a subfolder ? 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
Here is my github account to see if there any errors in setting up
For reference of the images here is the git link
解决方案
First, make sure to create a gh-pages
branch, add at least one commit in it and push it to your GitHub repository.
Then, yes, you can add that gh-pages
branch content as a subfolder of your current repository, in the master
branch, using git submodule
.
(unless, as explained here, you 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
You will have a gh-pages
subfolder, that you can update at any time with:
git submodule update --remote
推荐阅读
- python - PySpark 无法运行程序“python”
- html - 如何更改外部样式表中特定单词的颜色?
- c# - .NET Core 3.1 Identity 在 Azure 上登录的时间太长
- swift5 - 获取“线程 1 致命错误索引超出范围”
- swift - 转义闭包捕获 Swift 中的变异“自我”参数错误
- c++ - consteval 包装器与 source_location
- haskell - 在 Haskell 中进行嵌套函数调用
- eventbrite - Eventbrite API -- 参加者 API 返回 0 名参加者
- node.js - 节点正在打开一个新的 cmd 选项卡
- javascript - 使用 JS 顺序提取 zip 文件内容而不将整个 zip 加载到内存