Question

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:

Fire up a browser and go to http://username.github.io. Give it a couple of minutes for your page to show up—there will be a delay this very first time. In the future, changes will show up pretty much instantly.

My Github repo link is this: https://github.com/leongaban/gabanco

So I assumed my Github page link would be either:
http://leongaban.gabanco.github.io/

or

http://leongaban.github.io/

However neither link is working at the moment :(

Anyone create a Github page before? Eventually I want to try out Jekyll on it.

Was it helpful?

Solution 3

Rename your repository to <yourusername>.github.io as explained in the documentation.

To publish a user site, you must create a repository owned by your user account that's named <user>.github.io.

Edit: You can only use your own account name for a User or Org Pages repository. A repository like joe/bob.github.io will not build Pages.

OTHER TIPS

I'm not sure if the site just needed some time to show up, but I was getting a 404 error after pushing my master branch... Then I changed my 'theme' in the repo's settings. All of a sudden it started working! A file called config.yml appeared with the theme metadata.

Try to push an empty commit and refresh the page. It should work.

git commit --allow-empty -m "Trigger rebuild"
git push

If you have the correct repository name and you still get a 404 error a solution might be to push to the repository.

This is what worked for me. After the push it showed up instantly.

Name your repository correctly, as stated in the first step:

Head over to GitHub and create a new repository named username.github.io, where username is your username (or organization name) on GitHub.

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

What I did was to add a README.md file. I typed something in the README.md and committed the change to the main branch and immediately, the page started showing. Here it is: https://akcumeh.github.io/03-sunnyside

Interestingly, I've never had to do that before to be able to view my site, but I had to do that today. I think someone mentioned this in a previous answer on this same thread...

In my case I had the correct repository name and still got a 404 error. Then I found this answer, so I made a change and pushed again. This time the changes from my first push showed up. So I waited for a while and then few minutes later, the changes from my second pushed showed up. It might just be the case that changes are not visible instantaneously.

For me the second commit directly shown my Github page. This is very useful.

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.

you can simply change the folder from root to docs or vice versa.

It worked for me.

As of 2022, having created a repository,

  1. I had to navigate to project settings,
  2. then Pages,
  3. then click Enable (or similar), choose the branch I'd like to use (master in my case), save,
  4. then push a single commit to refresh GitHub Pages.

Project was hosted instantly under https://USERNAME.github.io/PROJECTNAME/.

Usually we can see the build pipeline and find out what the issue is. For example, In my case I am able to see files in commit and also generated html file. But unfortunately, I am not able to see and browse to that page.

enter image description here

We can navigate to last commit and next to our commit id, we can see a green tick mark. When we click on that tick mark, we can see build and deployment info something like this.

enter image description here

We can expand each step and see where exactly the issue is. In my case, after expanding build, I saw that my page is skipped

enter image description here

Problem here is, I gave date in my Jekyll admin and posted it. But GitHub is taking UTC date and I am from IST. So my time is still future time for GitHub. So I made sure that I gave delayed time and it worked.

I had the same problem. I think first you need to check out if YOUR Github Pages have been enabled. This you can check out from "setting". Then change whatever html web site from"github.com/username/repo1/repo2/repo3.../blob/master/file.html"

to "username.github.io/repo1/repo2/repo3.../file.html" .

Then have a try. Good luck.

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.

Turns out I had an error in my html file "No newline at end of file". Once I fixed this problem and did another Commit and Push, it worked.

go to project settings, and scroll down, find the github pages section. it might say you haven't choose a source. i chose one, and wait for 2 minutes, then it works.

Use the GitHub user name in the repository name first part. Wait 2 minutes after adding your age. Use google webmaster search console to verify the page you created in GitHub pagesenter image description here.

rahul-inspired-iosdeveloper.github.io

The solution that solved the 404 error page was to change the Branch from Master to gt-pages

In the case you have followed everything told in the steps such as : Repository name should be username.github.io

The main thing is you must add READ.md file to your repository. For sure your website will show up.

I had same issue with Angular app. I forgot to make repo public :) Even tho i didn't use the username/username.github.io repo naming scheme it worked at <username>.github.io/<repo-name>.

My page was working, but then I tried to connect it to Heroku which led to a 404 error. After switching back to the original, I still got the error. I got around this by going in the settings of the repo and actually changing the name.

Make sure that index.html file is present in your code otherwise it will give 400 error

Don't forget to enable Git Pages example

One other datapoint: check your branch.

When you create a new repo, the default branch is "main". The branch required for the GitHub page is "master".

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 it happened because i had my index.html file inside a folder from a main branch. For it to work you must have a file index.html directly just inside your first repositories not in any folders or sub-folders inside it. That's it.

Just do not panic and rename your GitHub Repository and view your page it gets uploaded and you can rename it to original name then after.

Adding the theme worked for me as well. Initially I thought I might have to wait longer for the index file to load, but it hasn't taken that long on prior repo's I have done.

Steps:

  1. Click on Settings in the Repo
  2. Click on Pages
  3. Click Change Theme

Simply add a theme and it should load the published page url.

Maybe you need to add readme file, because after I waited 15 minutes I added it, after that it worked

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top