很多关于GithubPages的教程都弄错了吧? 还是我理解错了?

发布于 2022-09-02 16:16:24 字数 2404 浏览 12 评论 0

一. 描述问题&上下文环境

讨论username.github.io这一类pages

只是Google了几篇教程,有的难以看懂不说,我发现有些概念可能还弄错了.
比如官方说发布分支是master,而许多教程认为是gh-pages
另外,pages其实有4种,而不是2种

  • 但是,有一句话令我困惑

Content from the master branch will be used to build and publish your GitHub Pages site.

上面那句话,让我糊涂了, master分支都可以build和publish了
那其实gh-pages分支没有什么用

  • 那实际上gh-pages分支是干嘛的?

另外,所有每种pages的目的,我都懂(其实官方链接已经很直白了https://help.github.com/articles/user-organization-and-project-pages/)

  • 我认为对UserPages完全没有必要弄得那么神秘(如很多教程那样), 直接master上写md,构建, 推送html到github即可, (又是这又是那的, 让人摸不着头脑)

二. 相关代码&重现

User & Organization Pages live in a special repository dedicated to GitHub Pages files. You will need to name this repository with the account name.

You must use the username.github.io naming scheme.
Content from the master branch will be used to build and publish your GitHub Pages site.
You can only use your own account name for a User or Organization Page repository. A repository like joe/bob.github.io will not build a User Pages site.

When User Pages are built, they are available at http(s)://<username>.github.io.

Building your User & Organization Pages

User Pages can be built by any user account with a verified email address. They can also use deploy keys to automate the process.

Organization Pages can be built by any member with push access to the repository and a verified email address. To automate builds, you can set up a machine user as a member of your organization. Deploy keys aren't supported for Organization Pages.

官方介绍: https://help.github.com/articles/user-organization-and-project-pages/

三. 报错信息

四. 相关截图

五. 已经尝试哪些方法仍然没有解决(附上相关链接)

  1. https://help.github.com/articles/user-organization-and-project-pages/

  2. 各种Pages是干嘛的,就不必复述官方manual了

六.问题简化

gh-pages分支干嘛的?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

玩心态 2022-09-09 16:16:24

Github Pages有两种
一个组织/个人主页面 会显示master分支

项目页是用来干嘛的呢
一般主页都是 组织或者个人用来介绍自己的。
项目页是用来介绍某个项目的。
一个人或者组织会有多个项目,所以项目页会显示gh-pages分支,方便扩展。

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文