147

I'm running into a weird issue with GitHub pages. I pushed a new commit to my personal pages page maltzj.github.io, but the new article isn't showing up there. When I execute the server locally, a post lives at localhost:4000/posts/the-price-of-inconsistent-code/. However, when I go to http://maltzj.github.io/posts/the-price-of-inconsistent-code I get a 404. I also added a new file which should live at http://maltz.github.io/test.html, but that also throws a 404.

Everything builds and runs locally. My Git repository is up to date, and there is nothing on the GitHub status page about problems with builds, so I'm at a little bit of a loss about where to go with this. How can I get my page to update with new content that I add?

For reference, the location of the repository which backs my page is http://github.com/maltzj/maltzj.github.io

6
  • "Are you trying to publish one? It may take up to ten minutes until your page is available."
    – Mmmh mmh
    Dec 6, 2013 at 11:13
  • 4
    I know that, but the publishing commits have been in the repo for > 5 hours and not shown up. Personal pages deploy via master correct?
    – Jonathan
    Dec 6, 2013 at 13:56
  • 6
    for me it was because the browser use cached data(old styles) so i opend other brwser Feb 2, 2018 at 18:28
  • 2
    Using Ctrl+Shift+R to hard reload the page helped me, as it was cache data used by the browser initially.
    – AbtabM
    Mar 24, 2021 at 12:04
  • 2
    You can trigger a rebuild on an empty commit. git commit --allow-empty -m "Trigger rebuild" and then git push. ref: stackoverflow.com/a/45907768 Apr 28, 2021 at 2:33

48 Answers 48

85

None of these solutions solved it for me. The solution was to edit the index.html file in the GitHub website.

The website then updates on the web as expected.

7
  • 9
    same for me. Only changing one line into index.html made it "load" the "true" index.html and not all the previous commit. Oct 22, 2015 at 16:10
  • 3
    GitHub Pages wasn't seeing an image I pushed in my last commit. I had to edit index.html (which uses the image), just by changing some white space, in order to get GitHub Pages to start serving the image. I suspect it doesn't rebuild unless an HTML page changes.
    – Paul Lynch
    Apr 13, 2017 at 21:09
  • 5
    I just added one space on GitHub in index.html and it worked. Weird issue.
    – Wolfram
    Sep 7, 2017 at 23:58
  • That make sense, this solution works for me.. In my case, it was due to my app being an SPA, where updates are only made in Javascript, and not from index.html. Then again, I think the filenames have md5sum (or something) and should change if the file changes, so it should update the index.html script tag as well.
    – jmjm
    Jan 19, 2019 at 18:28
  • 1
    What do mean by "edit the index.html file into GitHub website"? Oct 27, 2020 at 10:46
55

Go to your index.html file through your site (example.github.io/index.html) and then reload the page. Then you can go back to (example.github.io) and it should have updated. You can do the same with the master.css file, etc.

If it doesn't work, try reloading (github.com/example/example.github.io/[blob/master/]index.html) instead and it will have updated.

2
  • That's the way to do it. Thanks! 👍 Jan 15, 2022 at 16:32
  • example.github.io/index.html worked in my case. The problem was, that I changed my github's username. Then renamed the repository. Then when I tried to browse the webpage, it showed a 404 error. So, thanks! Sep 12, 2022 at 14:53
50

For others, also check the dates of your posts. I just had this problem. I'm at UTC+11 and I'm pretty sure the server is at UTC. Thus if I date my posts with my local time, the server thinks they are in the future and won't build them. Using UTC avoided this for me.

As mentioned by joao cenoura in the comments below:

  • you can tell jekyll to show "future" posts by adding future: true to your _config.yml
  • and/or add timezone: TIMEZONE to specify your timezone.

See https://jekyllrb.com/docs/configuration/ for more info.

4
  • 5
    Hooray! This was the problem for me. I typo'ed a post name and made it "2016-04-14" instead of "2016-03-14". It built just fine locally, but on Github, it didn't show up. No warning, just no page. Thanks! Mar 18, 2016 at 5:42
  • 1
    Same issue. I'm at UTC+8. I made a post with today as its date, pushed and nothing happened. Then I changed the date of the post and made it yesterday, the post got published really quick!
    – Hong
    Apr 20, 2016 at 13:12
  • 4
    Same for me on UTC+1. Haven't tried yet, but you can tell jekyll to show "future" posts by adding future: true to your _config.yml. There's also a TZ option. Reference: jekyllrb.com/docs/configuration May 2, 2016 at 20:01
  • 1
    Adding future: true to _config.yml worked no need to update timezone
    – Infinity
    Sep 24, 2020 at 20:20
12

I had an empty CNAME file. Check that if you're having a similar issue.

2
  • 22
    Would you please expand on this a bit? What did you have to change to make it work? Or did you have to remove a CNAME file that was there? Thanks!
    – cxw
    Aug 7, 2015 at 2:48
  • 1
    I had to make sure the CNAME file contained a line with the domain I wanted to be built. Aug 11, 2016 at 22:57
12

I had this fault today with a static page - the cause was actually a service failure at GitHub Pages itself. You can check for service messages at https://www.githubstatus.com/.

4
  • 1
    I tore out nearly my whole site trying to reduce a code problem - turns out github has had a huge page build backlog happening since yesterday - that's almost 24 hours. (Github should note the build status page link on their Troubleshooting page. I only found the status page because of a 404 error which included a link at the bottom.) Oct 22, 2018 at 22:25
  • 1
    Thank you:) Today I got "Investigating - Currently investigating increase in queue backlogs affecting Pages builds and some webhooks deliveries."
    – Thuan
    Nov 5, 2019 at 14:43
  • Yeah me too! @Thuan. it's sucks! Nov 5, 2019 at 16:17
  • This happened! -2021
    – Jason Kao
    Mar 22, 2021 at 21:44
10

I had the problem of having an unverified email. The update worked for the first time, but it failed after that. A verified email is needed to trigger a GitHub pages build. Also a deploy key cannot be used for this, as it won't trigger a build.

Source: http://web.archive.org/web/20140712011932/https://help.github.com/articles/troubleshooting-github-pages-build-failures/

Disclaimer: this was the case in 2014. Don't know if it's still required.

5
  • 1
    I also had the very same problem of an unverified email. Jan 20, 2015 at 6:43
  • This is what helped me. It's also the only mention of this solution I could find after about an hour of looking.
    – Giganticus
    Aug 9, 2015 at 5:21
  • 1
    Deploy key won't trigger the build!?!? WTF. Thank you, upvoted.
    – Domenic
    Sep 2, 2016 at 22:08
  • 1
    The link is broken ("Ooops! It looks like this page doesn't exist."). Mar 31, 2020 at 0:06
  • @PeterMortensen replaced with web archive link, though don't really know if the information is relevant anymore
    – eis
    Mar 31, 2020 at 15:04
8

I had an unclosed <a> tag which caused the build to be pending forever. Fixing that solved the issue.

It makes sense that GitHub would verify your links.

1
  • Yep... I had a missing space between the href="" and target="" Sep 13, 2020 at 19:46
7

I got it to work. Mine was a simple problem. It was a browser cache problem.

I opened my link on a different browser and it showed me the updated push.

3
  • Upvoting this because it was exactly why mine was showign an outdated version . Use CTRL + F5 or hold CTRL and click the browser's refresh button. Sep 24, 2020 at 18:50
  • Same here. I had to open the console F12 and right click on the top left reload button and choose Empty cache and hard reload
    – Stephane
    Apr 16, 2022 at 8:56
  • Same with me...
    – Chen Peleg
    Jun 28, 2022 at 8:19
6

In my case, none of above solutions works. Finally I find out the reason is: there is "relative_permalinks" option in my _config.yml. This option is recently deprecated in Jekyll 3.0.

Refer to: https://help.github.com/articles/removing-relative-permalinks/

0
6

I know this might sound simple, but make certain you are on the right branch and in the right file.

In my case, I made a GitHub page and tried to commit from my local repository on the master branch. Also, I was updating my filename instead of index.html. These were my errors. I had to switch to the GitHub page branch and update in the index.html commit, push and then everything worked fine.

2
  • Funny. This answer inspired me to reassess my assumptions and reminded me that I needed to re-build from source.
    – jorisw
    Apr 21, 2020 at 10:49
  • Thank you so much! My problem was that I was making changes on my main branch but not deploying to the gh-pages branch. If you have set up github pages, there is usually a command in your config file that allows you to deploy.
    – Marlo
    Dec 16, 2022 at 15:20
4

For me, I just waited ~5 minutes, and it was updated.

If someone has made the branch gh-pages from scratch (manually) the problem is that you need a file call params.json to make it work.

I don't have this params.json file, but it still works...

1
  • You can see if Github still needs time building your site or if it failed in the commits list of your repo.
    – Lukas
    Oct 22, 2018 at 22:41
4

In my case the problem was because of my repository was private. After I made it public, the problem has gone.

The weird part of story is that I was able to create private repository and use GitHub pages with it. I did it in accordance with the official guide (http://take.ms/p2SS7). It worked fine for about 9 commits, but on the 10-th it became broken.

1
  • 1
    Thank you. My issue was that GitHub Pages did not auto-deploy at all. I had tried multiple ways like empty cache, pushed an empty commit, etc. but it didn't work. Changing from private to public triggered the auto-deployment immediately. Mar 20, 2022 at 14:34
3

In my case, it happened to be that I mentioned a relative path to refer to an image, something like - ./test.png.

It seems that it's not allowed, and it may be a security issue or what. Whatever, if you've done something like that, remove it and refer to it as test.png.

1
  • 1
    Same for me: I had a relative path in an "<a href...>" Mar 1, 2016 at 21:03
3

I ran into the same mysterious issue today. I pushed some new code to my github.io-repository, but the changes did not show up on the corresponding webpage. I inspected the page and did not see the new code in the source. I solved the issue by doing a hard reload. On Chrome, you can do a hard reload by opening up Dev Tools and right-clicking on the refresh-button and choosing Hard Reload.

1
  • 2
    Or in chrome you can "Ctrl+Shift+R" for hard reload
    – AbtabM
    Mar 24, 2021 at 12:02
2

Please refer to the Jekyll troubleshooting website, as there are multiple error sources: Troubleshooting Jekyll build errors for GitHub Pages sites

In my case a German umlaut ("ö") in a Markdown file caused the problem.

2

In my case, I forgot to define kramdown in _config.yaml

# Build settings
markdown: kramdown

This was caused when I was converting from a theme without to a theme with the kramdown requirement.

2
  1. Make sure your run npm run deploy

  2. Clear your browser cache.

1

In my case, after trial and error on some solutions here, what fixed it was adding the encoding to the _config file like this

encoding: UTF-8

More troubleshooting options here

1

For me it was an issue with not properly having a .gitmodules file.

I was able to troubleshoot in the settings tab of my repository, under the GitHub pages section, which indicates build issues and was helpful for troubleshooting.

1

Oddly (and simply) enough I created a new branch, made that branch the "default" branch and pushed from there.

This worked for me.

0
1

My GitHub Pages was turned off under the Settings tab of the repository.

I don't remember turning it off, but there it was, and turning it back on was the fix.

1

In the repository settings, make sure the GitHub Pages is currently being built from the gh-pages branch.

1

In my case, my problem was after git push my GitHub file was updating but not showing my website on GitHub pages.

Note: I was creating Website by React

Also, on the HTML project, I faced the same problem. In that case, I just did first of all git pull and then git status | git add . | git commit -m"adding some content" | and git push. It worked for me.

But in the React project, it didn't work. I run this again on my cmd npm run deploy then my React web application is showing on GitHub pages.

My suggestion is to try everything showing on this post comments. Because the solution to this problem is not one.

2
  • 1
    With react you should first build the project with npm run build or yarn build and then push to github pages build/ folder. Or you can access it with link yournickname.github.io/yourproject/build path (If you remove build/ from .gitignore)
    – flppv
    Mar 18, 2019 at 2:14
  • For showing react website on GitHub pages I followed this method github.com/gitname/react-gh-pages and it worked.
    – iamtheasad
    Mar 18, 2019 at 6:08
1

In my case I left an empty parameter, url, in _config.yaml.

After I've specified url: example.github.io everything started to work.

1
  • 1
    This was really helpful
    – BZKN
    May 30, 2022 at 9:56
1

I had this problem this week and no solution worked. I don't use Jekyll, only pure static HTML. It just sat three days refusing to update.

Here is what I had to do to get it to publish again.

  • Make a snapshot branch from master.
  • Reset the master branch to the last commit that is live. (Commits tab, green checkmarks indicate published commits)
  • Make a new commit with a smoke test. I made an HTML comment I could grep.
  • Force push master.
  • Check results curl https://example.com | grep SMOKETEST
  • Reset master again, removing the smoke test.
  • Cherry-pick each commit from the snapshot branch you need to get your unpublished changes back into master (cherry-picking gives the commits new ids/hashes, avoiding the risk of anything having cached them from before).
  • Force push master again.
  • Now you should get green checkmarks and published updates.

Note: It could be enough to force push to remove the commits that are stuck and getting them back again. The smoke test is almost certainly not required. Cherry-picking may not be required.

1

Github doesn't publish to github pages for me if I edit and commit files directly on github web site.

However, if I edit file locally and commit with GitHub Desktop, then change is published to site within seconds.

BTW, my email is verified, so this shouldn't be an issue. And I'm using same account.

1

Solution worked for me for an app created using create-react-app :

  1. Go to GitHub Pages section under repository settings
  2. Change source from gh-pages branch to master branch
  3. Wait and check your custom domain website, should show master branch README.md file
  4. Now change the source back to gh-pages
  5. Wait couple minutes, now latest changes reflected on custom domain website

I had tried different solutions, none worked. Like a new commit, an empty commit, browser cache clear, wait for 5 - 10 minutes, delete gh-pages branch and push again, edit CNAME, create a new CNAME under on master branch etc

Note: My app has no _config.yaml file, no jekyll. I'm using custom domain with https (google domains). gh-page branch auto created by package.json script deploy: "gh-pages -d deploy"

1

In my case, I had made a couple of changes in the index.html and style.css files but those changes were not reflecting on the Github pages. But when I updated the Readme file by adding one line the Page got updated. Maybe you can try this, as it might work for you just like it did for me.

1
  • same. Tried to update only index.html several times and no update. After I updated README.md (or delete it) - instant update
    – tandav
    May 3, 2021 at 19:31
1

If you are deploying some simple HTML codes, try this:

First, go to Actions > Deploy static content to Page:

enter image description here

Then, click the Run workflow:

enter image description here

1

My site failed to deploy today because of a transient failure in the GitHub Pages deploy actions. The action needed to be re-run through the Actions tab for the new version of my site to appear.

The story:

I pushed new content, on a site that's purely static and doesn't use Jekyll. After many fruitless Shift-Ctrl-R reloads on Chrome, I decided to investigate. I first visited Settings→Pages for the site’s repository, and saw that no recent deploy had taken place.

GitHub saying the last deploy was 2 months ago

Why not, I wondered? After double-checking that my push had really gone through, I clicked the word “deployed”, and was taken to a GitHub Action that had failed!

GitHub error ECONNRESET

Since the error message ECONNRESET looked like a generic network error internal to GitHub’s network, and not any problem with my site, I clicked the “Re-run” button in the upper right and asked GitHub Actions to re-run the failed task. Within a few seconds it had been re-tried and had succeeded!

Lessons:

  1. Deploys are vulnerable to transient errors.
  2. Deploys these days happen as normal GitHub Actions that you can inspect.
  3. The deploys can be re-tried.

Not the answer you're looking for? Browse other questions tagged or ask your own question.