我创建了 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
有什么问题?
文档提到 https://help.github.com/articles/creating-pages-with-the-automatic-generator/:
如果您生成了用户页面站点,则代码位于master
分支而不是gh-pages
branch.
在您的情况下,您可能想要创建并推送主分支。
git checkout -b master
git push -u origin master
2016 年 8 月更新:更简单的 GitHub Pages 发布 https://github.com/blog/2228-simpler-github-pages-publishing现在允许将页面文件保存在same分支(没有了gh-pages
需要):
这意味着项目页面现在可以also继续生活master
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)