问题
I created repo [username].github.io, pushed first commit in gh-pages branch, have been waiting for 30 mins (GitHub says, it shouldn't take more than 10) and got 404 page trying to load my page. Checked out with different browsers, results are the same.
Here's the way how I've done it:
$ 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
What's the problem?
回答1:
The documentation mentions:
If you generated a User Pages site, the code lives in the
master
branch instead of thegh-pages
branch.
In your case, you might want to create and push a master branch.
git checkout -b master
git push -u origin master
Update August 2016: Simpler GitHub Pages publishing now allows to keep your page files in a subfolder of the same branch (no more gh-pages
needed):
That means project pages can now also live on master
.
来源:https://stackoverflow.com/questions/27202065/why-github-pages-on-username-github-io-wont-show