【问题标题】:Why GitHub pages on [username].github.io won't show?为什么 [username].github.io 上的 GitHub 页面不会显示?
【发布时间】:2015-01-27 21:42:19
【问题描述】:

我创建了 repo [username].github.io,在 gh-pages 分支中推送了第一个提交,已经等待了 30 分钟(GitHub 说,它不应该超过 10 分钟)并且尝试加载我的 404 页面页。 用不同的浏览器检查,结果都是一样的。

这是我的做法:

$ git clone http://github.com/RedCorbie/RedCorbie.github.io
$ git add index.html 
$ git commit -m "Initial commit"
$ git branch gh-pages
$ git push origin gh-pages

有什么问题?

【问题讨论】:

    标签: github github-pages


    【解决方案1】:

    The documentation mentions:

    如果您生成了用户页面站点,则代码位于 master 分支而不是 gh-pages 分支中。

    在您的情况下,您可能想要创建并推送一个主分支。

    git checkout -b master
    git push -u origin master
    

    2016 年 8 月更新:Simpler GitHub Pages publishing 现在允许将您的页面文件保存在 same 分支的子文件夹中(不再需要 gh-pages):

    这意味着项目页面现在可以在 master 上运行。

    【讨论】:

    • 谢谢,这有帮助。很多人(包括我)没有意识到项目页面和用户页面之间的细微差别。
    猜你喜欢
    • 2023-01-24
    • 2018-07-07
    • 2017-02-19
    • 2021-12-13
    • 1970-01-01
    • 1970-01-01
    • 2013-01-26
    • 2017-11-24
    • 1970-01-01
    相关资源
    最近更新 更多