So I\'m following this guide here to create a Github page
I created a repository, cloned it to my project directory and pushed, finally got to this last step:
I had the same problem. I fixed it by going to the Settings
for the repository and changing the name of the Repository to username.github.io
If anyone else is using the gh-pages NPM library to deploy (i.e. for a React app), you need to do one more step after deploying.
From your GitHub settings page, scroll down to "GitHub Pages" and change the source branch to "gh-pages". This branch should created automatically for you once you deploy your app.
In my case, my page repository uses the username/username.github.io naming scheme, but still cannot work.
I just clone the repository to local, and new a push_test.txt file and push it to the repository, and then https://username.github.io works.
If you have named your repository correctly like <username>.github.io
, and it is showing Github pages is under maintenance, then wait for a few minutes and then refresh. Your site will show up.
But, if it is showing 404 error, then check if you have index.html in your root folder and your Github pages setting is enabled from the settings tab.
Go to this link - https://github.com/<username>/<username>.github.io/settings
And check Github Pages section in which you have to configure the Source.
Make sure that index.html file is present in your code otherwise it will give 400 error
Try to push an empty commit and refresh the page. It should work.
git commit --allow-empty -m "Trigger rebuild"
git push