Reputation: 39034
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
However neither link is working at the moment :(
Anyone create a Github page before? Eventually I want to try out Jekyll on it.
Upvotes: 74
Views: 210082
Reputation: 1304
Confirm that the file is actually in the repository (that you didn't forget to git add -A
).
In my case, I could see in the deployment pipeline that Jenkins build was not rendering the new page that I was adding while rendering the others, but I didn't realize it wasn't actually in the repository (I was working in Codespaces, btw - just trying to add a quick post).
With magical systems like this, you sometimes start from the assumption you're missing some reference somewhere, but it turns out it's just a careless mistake.
Upvotes: 0
Reputation: 322
Mine wasn't updating due to a submodule that it couldn't access:
2024-07-10T16:37:52.0103628Z Syncing repository: RokeJulianLockhart/rokejulianlockhart.github.io 2024-07-10T16:37:52.0105832Z ##[group]Getting Git version info 2024-07-10T16:37:52.0106798Z Working directory is '/home/runner/work/rokejulianlockhart.github.io/rokejulianlockhart.github.io' 2024-07-10T16:37:52.0107900Z [command]/usr/bin/git version 2024-07-10T16:37:52.0183814Z git version 2.45.2 2024-07-10T16:37:52.0210326Z ##[endgroup] 2024-07-10T16:37:52.0228081Z Temporarily overriding HOME='/home/runner/work/_temp/e9ef3404-1625-4b30-ae5e-68acd506cf72' before making global git config changes 2024-07-10T16:37:52.0229252Z Adding repository directory to the temporary git global config as a safe directory 2024-07-10T16:37:52.0238819Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/rokejulianlockhart.github.io/rokejulianlockhart.github.io 2024-07-10T16:37:52.0278744Z Deleting the contents of '/home/runner/work/rokejulianlockhart.github.io/rokejulianlockhart.github.io' 2024-07-10T16:37:52.0282426Z ##[group]Initializing the repository 2024-07-10T16:37:52.0287160Z [command]/usr/bin/git init /home/runner/work/rokejulianlockhart.github.io/rokejulianlockhart.github.io 2024-07-10T16:37:52.0419158Z hint: Using 'master' as the name for the initial branch. This default branch name 2024-07-10T16:37:52.0420683Z hint: is subject to change. To configure the initial branch name to use in all 2024-07-10T16:37:52.0422233Z hint: of your new repositories, which will suppress this warning, call: 2024-07-10T16:37:52.0427689Z hint: 2024-07-10T16:37:52.0429087Z hint: git config --global init.defaultBranch <name> 2024-07-10T16:37:52.0429838Z hint: 2024-07-10T16:37:52.0430793Z hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and 2024-07-10T16:37:52.0432205Z hint: 'development'. The just-created branch can be renamed via this command: 2024-07-10T16:37:52.0433097Z hint: 2024-07-10T16:37:52.0433563Z hint: git branch -m <name> 2024-07-10T16:37:52.0434870Z Initialized empty Git repository in /home/runner/work/rokejulianlockhart.github.io/rokejulianlockhart.github.io/.git/ 2024-07-10T16:37:52.0441612Z [command]/usr/bin/git remote add origin https://github.com/RokeJulianLockhart/rokejulianlockhart.github.io 2024-07-10T16:37:52.0492340Z ##[endgroup] 2024-07-10T16:37:52.0492939Z ##[group]Disabling automatic garbage collection 2024-07-10T16:37:52.0496594Z [command]/usr/bin/git config --local gc.auto 0 2024-07-10T16:37:52.0532301Z ##[endgroup] 2024-07-10T16:37:52.0533078Z ##[group]Setting up auth 2024-07-10T16:37:52.0540422Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand 2024-07-10T16:37:52.0575896Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :" 2024-07-10T16:37:52.1021889Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader 2024-07-10T16:37:52.1057886Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :" 2024-07-10T16:37:52.1311823Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic *** 2024-07-10T16:37:52.1362908Z ##[endgroup] 2024-07-10T16:37:52.1363913Z ##[group]Fetching the repository 2024-07-10T16:37:52.1374113Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +refs/heads/main*:refs/remotes/origin/main* +refs/tags/main*:refs/tags/main* 2024-07-10T16:37:52.6400456Z From https://github.com/RokeJulianLockhart/rokejulianlockhart.github.io 2024-07-10T16:37:52.6401435Z * [new branch] main -> origin/main 2024-07-10T16:37:52.6427952Z ##[endgroup] 2024-07-10T16:37:52.6428907Z ##[group]Determining the checkout info 2024-07-10T16:37:52.6435906Z [command]/usr/bin/git branch --list --remote origin/main 2024-07-10T16:37:52.6462661Z origin/main 2024-07-10T16:37:52.6469468Z ##[endgroup] 2024-07-10T16:37:52.6474872Z [command]/usr/bin/git sparse-checkout disable 2024-07-10T16:37:52.6519013Z [command]/usr/bin/git config --local --unset-all extensions.worktreeConfig 2024-07-10T16:37:52.6549537Z ##[group]Checking out the ref 2024-07-10T16:37:52.6554297Z [command]/usr/bin/git checkout --progress --force -B main refs/remotes/origin/main 2024-07-10T16:37:52.6598953Z Switched to a new branch 'main' 2024-07-10T16:37:52.6601422Z branch 'main' set up to track 'origin/main'. 2024-07-10T16:37:52.6607417Z ##[endgroup] 2024-07-10T16:37:52.6608380Z ##[group]Setting up auth for fetching submodules 2024-07-10T16:37:52.6613802Z [command]/usr/bin/git config --global http.https://github.com/.extraheader AUTHORIZATION: basic *** 2024-07-10T16:37:52.6653019Z [command]/usr/bin/git config --global --unset-all url.https://github.com/.insteadOf 2024-07-10T16:37:52.6686660Z [command]/usr/bin/git config --global --add url.https://github.com/.insteadOf [email protected]: 2024-07-10T16:37:52.6720411Z [command]/usr/bin/git config --global --add url.https://github.com/.insteadOf [email protected]: 2024-07-10T16:37:52.6751453Z ##[endgroup] 2024-07-10T16:37:52.6752624Z ##[group]Fetching submodules 2024-07-10T16:37:52.6756730Z [command]/usr/bin/git submodule sync --recursive 2024-07-10T16:37:52.7009354Z [command]/usr/bin/git -c protocol.version=2 submodule update --init --force --depth=1 --recursive 2024-07-10T16:37:52.7253483Z Submodule 'rokejulianlockhart' (https://gitlab.com/rokejulianlockhart/rokejulianlockhart.git) registered for path 'rokejulianlockhart' 2024-07-10T16:37:52.7282913Z Cloning into '/home/runner/work/rokejulianlockhart.github.io/rokejulianlockhart.github.io/rokejulianlockhart'... 2024-07-10T16:37:53.4668019Z Submodule path 'rokejulianlockhart': checked out 'fbbb0ab0ebb69bd649a382e7d3a0b578fac2b46d' 2024-07-10T16:37:53.4686365Z Submodule 's4a3h4' (https://gitlab.com/rokejulianlockhart/s4a3h4.git) registered for path 'rokejulianlockhart/s4a3h4' 2024-07-10T16:37:53.4691333Z Submodule 'sg5n9q' (https://gitlab.com/rokejulianlockhart/sg5n9q.git) registered for path 'rokejulianlockhart/sg5n9q' 2024-07-10T16:37:53.4722675Z Cloning into '/home/runner/work/rokejulianlockhart.github.io/rokejulianlockhart.github.io/rokejulianlockhart/s4a3h4'... 2024-07-10T16:37:53.6558012Z ##[error]fatal: could not read Username for 'https://gitlab.com': terminal prompts disabled 2024-07-10T16:37:53.6570130Z ##[error]fatal: clone of 'https://gitlab.com/rokejulianlockhart/s4a3h4.git' into submodule path '/home/runner/work/rokejulianlockhart.github.io/rokejulianlockhart.github.io/rokejulianlockhart/s4a3h4' failed 2024-07-10T16:37:53.6571941Z Failed to clone 's4a3h4'. Retry scheduled 2024-07-10T16:37:53.6596897Z Cloning into '/home/runner/work/rokejulianlockhart.github.io/rokejulianlockhart.github.io/rokejulianlockhart/sg5n9q'... 2024-07-10T16:37:54.5243035Z Cloning into '/home/runner/work/rokejulianlockhart.github.io/rokejulianlockhart.github.io/rokejulianlockhart/s4a3h4'... 2024-07-10T16:37:54.6897160Z ##[error]fatal: could not read Username for 'https://gitlab.com': terminal prompts disabled 2024-07-10T16:37:54.6924448Z ##[error]fatal: clone of 'https://gitlab.com/rokejulianlockhart/s4a3h4.git' into submodule path '/home/runner/work/rokejulianlockhart.github.io/rokejulianlockhart.github.io/rokejulianlockhart/s4a3h4' failed 2024-07-10T16:37:54.6927308Z Failed to clone 's4a3h4' a second time, aborting 2024-07-10T16:37:54.6928621Z ##[error]fatal: Failed to recurse into submodule path 'rokejulianlockhart' 2024-07-10T16:37:54.6985458Z ##[error]The process '/usr/bin/git' failed with exit code 1
...despite the submodule being public, and despite GitHub supposedly supporting it. I expect that the problem was that GitHub was trying to recursively clone the submodules' submodules, and one of them contains a private repository.
Upvotes: -1
Reputation: 39
The index page as in whatever.html has to say index.html; I've tried to publish a site and forgot all about that wow three times and finally published
Upvotes: -1
Reputation: 480
You should check the settings of your project to enable it:
Setting > GitHub Pages >Build and deployment > Branches
(the main branch must be selected)
Upvotes: 0
Reputation: 1078
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.
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.
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
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.
Upvotes: 2
Reputation: 502
As of 2022, having created a repository,
master
in my case), save,Project was hosted instantly under https://USERNAME.github.io/PROJECTNAME/
.
Upvotes: 10
Reputation: 1
Maybe you need to add readme file, because after I waited 15 minutes I added it, after that it worked
Upvotes: 0
Reputation: 57
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...
Upvotes: 3
Reputation: 1
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:
Simply add a theme and it should load the published page url.
Upvotes: 0
Reputation: 121
you can simply change the folder from root to docs or vice versa.
It worked for me.
Upvotes: 2
Reputation: 321
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.
Upvotes: 0
Reputation: 321
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.
Upvotes: 0
Reputation: 1
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.
Upvotes: 0
Reputation: 2586
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".
Upvotes: 0
Reputation: 311
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.
Upvotes: 2
Reputation: 491
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.
Upvotes: 1
Reputation: 1
Make sure that index.html file is present in your code otherwise it will give 400 error
Upvotes: 0
Reputation: 16820
For me the second commit directly shown my Github page. This is very useful.
Upvotes: 2
Reputation: 3311
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.
Upvotes: 33
Reputation: 791
Try to push an empty commit and refresh the page. It should work.
git commit --allow-empty -m "Trigger rebuild"
git push
Upvotes: 65
Reputation: 296
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.
Upvotes: 0
Reputation: 41
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>
.
Upvotes: 0
Reputation: 1521
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.
Upvotes: 0
Reputation: 15
The solution that solved the 404 error page was to change the Branch from Master to gt-pages
Upvotes: 0
Reputation: 796
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 pages.
rahul-inspired-iosdeveloper.github.io
Upvotes: 0
Reputation: 367
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.
Upvotes: 1
Reputation: 828
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.
Upvotes: 59
Reputation: 11
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.
Upvotes: 1
Reputation: 851
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.
Upvotes: 2