GitHub pages are not updating

GithubGithub Pages

Github Problem Overview


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

Github Solutions


Solution 1 - Github

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.

Solution 2 - Github

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.

Solution 3 - Github

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.

Solution 4 - Github

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

Solution 5 - Github

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.

Solution 6 - Github

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/.

Solution 7 - Github

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.

Solution 8 - Github

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/

Solution 9 - Github

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.

Solution 10 - Github

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.

Solution 11 - Github

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.

Solution 12 - Github

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...

Solution 13 - Github

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.

Solution 14 - Github

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.

Solution 15 - Github

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.

Solution 16 - Github

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.

Solution 17 - Github

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

Solution 18 - Github

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.

Solution 19 - Github

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

This worked for me.

Solution 20 - Github

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.

Solution 21 - Github

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

Solution 22 - Github

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.

Solution 23 - Github

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.

Solution 24 - Github

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.

Solution 25 - Github

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"

Solution 26 - Github

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.

Solution 27 - Github

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.

This is an example of that file :

{
  "name": "nameOfProyect",
  "tagline": "name of proyect",
  "body": "### Welcome to GitHub Pages.\r\nThis automatic page generator is the easiest way to create beautiful pages for all of your projects. Author your page content here using GitHub Flavored Markdown, select a template crafted by a designer, and publish. After your page is generated, you can check out the new branch:\r\n\r\n```\r\n$ cd your_repo_root\/repo_name\r\n$ git fetch origin\r\n$ git checkout gh-pages\r\n```\r\n\r\nIf you're using the GitHub for Mac, simply sync your repository and you'll see the new branch.\r\n\r\n### Designer Templates\r\nWe've crafted some handsome templates for you to use. Go ahead and continue to layouts to browse through them. You can easily go back to edit your page before publishing. After publishing your page, you can revisit the page generator and switch to another theme. Your Page content will be preserved if it remained markdown format.\r\n\r\n### Rather Drive Stick?\r\nIf you prefer to not use the automatic generator, push a branch named `gh-pages` to your repository to create a page manually. In addition to supporting regular HTML content, GitHub Pages support Jekyll, a simple, blog aware static site generator written by our own Tom Preston-Werner. Jekyll makes it easy to create site-wide headers and footers without having to copy them across every page. It also offers intelligent blog support and other advanced templating features.\r\n\r\n### Authors and Contributors\r\nYou can @mention a GitHub username to generate a link to their profile. The resulting `<a>` element will link to the contributor's GitHub Profile. For example: In 2007, Chris Wanstrath (@defunkt), PJ Hyett (@pjhyett), and Tom Preston-Werner (@mojombo) founded GitHub.\r\n\r\n### Support or Contact\r\nHaving trouble with Pages? Check out the documentation at https:\/\/help.github.com\/pages or contact [email protected] and we\u2019ll help you sort it out.\r\n",
  "google": "",
  "note": "Don't delete this file! It's used internally to help with page regeneration."
}

Solution 28 - Github

In my case it was incorrect kramdown syntax. My code was

  {% highlight %}
  lorem lipsum
 {% endhighlight %}

Apparently you must tell kramdown the language:

  {% highlight html %}
  lorem lipsum
 {% endhighlight %}

Solution 29 - Github

In my case there were two problems (one "pebcak" and then a more valid one).

I had two email addresses set up in GitHub and I was checking the non-primary email for build error messages (to manage emails: log in to GitHub, click on user menu on the top right, select Settings and then "Emails" from the left menu -build error messages will arrive at the primary email set).

Once I got to see the error messages I found out I had added a description, including a ":" character in my _config.yaml and since this is the character used to separate key,value pairs, it was preventing the site to build.

Solution 30 - Github

In my case, I had another file with the same permalink to the page that was not refreshing the content. Pay attention to that.

Solution 31 - Github

I had the same issue, but in my case CNAME contained the correct domain name.

I think the problem had something to do with repository renaming I did before... The online name was different from local, although there were no issues on pushing and online files got updated - the live version did not.

After deleting the repository from the local machine and cloning it from GitHub again, the problem got solved.

Solution 32 - Github

To my mind, GitHub pages is late from one commit. This means if you want it to refresh, add any modification to your source, commit, and push.

This behavior only applies for the gh-pages branch and the any.github.io repository. In the "docs" folder, the modifications apply directly.

Solution 33 - Github

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

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

Solution 34 - Github

I used git commit -am "blah" and forgot that only my navigation links in _data/navigation.yaml were changed, and the new page.md that I created was not added to the working tree, therefore showing me a 404 error when I clicked on the link in the navigation tree.

Check, double check!

Solution 35 - Github

Check your build status of gh-pages in settings tab.

Your site is having problems building: Unable to build page.

If you are using github_token, it might not have permission to build the gh-pages so you might see a warning in the settings tab. That's why editing index.html might work. In this case use access_token or ssh based commit to automatically push and build gh-pages.

Solution 36 - Github

Go to

> Settings / GitHub Pages / Source

and change it to

> None (Disable GitHub Pages)

Let the system to save your changes. After that, change

> Settings / GitHub Pages / Source

again to its original value.

Solution 37 - Github

  1. Make sure your run npm run deploy

  2. Clear your browser cache.

Solution 38 - Github

If you're using the gh-pages command to publish, it could be a caching issue with gh-pages itself. See the bottom of the gh-pages docs:

However, note that those instructions are faulty!

To delete your gh-pages cache, either run node node_modules/gh-pages/bin/gh-pages-clean or manually delete the .cache directory in node_modules/gh-pages.

I've submitted an issue to correct the instructions here: https://github.com/tschaub/gh-pages/issues/367

Solution 39 - Github

Make sure to clear your web history and have a go at it again. My problem was solved with that itself.

Solution 40 - Github

I had the same issue with a very basic project. A hard reload [ctrl + shift + r] solved this for me.

Mine was just a basic project which used plain HTML, CSS, and JavaScript. The above method may or may not work for advanced projects.

Solution 41 - Github

I tried almost all the answers, tried editing index.html etc.

My mistake was, I was not building and deploying, so I have added build and deploy steps in my npm script. If you are using React application than directly copy paste this or just take the code.

These are my build scripts:

  "scripts": {
    "predeploy": "npm run build",
    "deploy": "gh-pages -b master -d build",
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  }

Once you are done with the changes, and your application is running fine using npm start. Follow these steps:

Step 1: run the command npm run build.

If everything is good then, you will get the message: the build folder is ready to deploy

enter image description here

Step 2: run the command npm run deploy

You will get the message like this: published.

enter image description here

Step 3: Refresh your app: like https://kushalseth.github.io. Not mandatory, but do commit and push all the changes for reference.

PS: If you are facing this issues like 404 then check this answer: https://stackoverflow.com/questions/53797321/react-github-pages-deploy-err-aborted-404-not-found/67376311#67376311

Solution 42 - Github

I had the same problem. In my case I have replaced my avatar with a new one. Previous had extension "jpeg" and new one "jpg", so I renamed file to have the same extension as previous one. I waited one day but changes did not appear. I noticed that the build failed. I renamed file to have its correct extension and changed a html-file corresponding. Build was ready in 2 minutes.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJonathanView Question on Stackoverflow
Solution 1 - GithuborafaelreisView Answer on Stackoverflow
Solution 2 - GithubTristan PriceView Answer on Stackoverflow
Solution 3 - GithubSebastian CarrollView Answer on Stackoverflow
Solution 4 - GithubJonathanView Answer on Stackoverflow
Solution 5 - GithubeisView Answer on Stackoverflow
Solution 6 - GithubMikeView Answer on Stackoverflow
Solution 7 - GithubjnsView Answer on Stackoverflow
Solution 8 - GithubFlickerlightView Answer on Stackoverflow
Solution 9 - GithubShowLoveView Answer on Stackoverflow
Solution 10 - Githubanto004View Answer on Stackoverflow
Solution 11 - GithubRahul NaskarView Answer on Stackoverflow
Solution 12 - Githubmath2001View Answer on Stackoverflow
Solution 13 - GithubDanView Answer on Stackoverflow
Solution 14 - GithubSara OnvalView Answer on Stackoverflow
Solution 15 - GithubMaximilian KohlView Answer on Stackoverflow
Solution 16 - GithubarewmView Answer on Stackoverflow
Solution 17 - GithubA. RomeuView Answer on Stackoverflow
Solution 18 - Githubuser3882631View Answer on Stackoverflow
Solution 19 - GithubKevin ConklinView Answer on Stackoverflow
Solution 20 - GithubJasonView Answer on Stackoverflow
Solution 21 - GithubDong JustinView Answer on Stackoverflow
Solution 22 - GithubiamtheasadView Answer on Stackoverflow
Solution 23 - GithubMartin WestinView Answer on Stackoverflow
Solution 24 - GithubzmechanicView Answer on Stackoverflow
Solution 25 - GithubUday Sravan KView Answer on Stackoverflow
Solution 26 - GithubDevansu YadavView Answer on Stackoverflow
Solution 27 - GithubRoberto Fernandez DiazView Answer on Stackoverflow
Solution 28 - GithubQuanntView Answer on Stackoverflow
Solution 29 - GithubFloellaView Answer on Stackoverflow
Solution 30 - GithubAdelson AraújoView Answer on Stackoverflow
Solution 31 - GithubMytko EnkoView Answer on Stackoverflow
Solution 32 - GithubparisniView Answer on Stackoverflow
Solution 33 - GithubAlex MedveshchekView Answer on Stackoverflow
Solution 34 - GithubclownfishhumanView Answer on Stackoverflow
Solution 35 - Githubkamalkishor1991View Answer on Stackoverflow
Solution 36 - GithuboocantoView Answer on Stackoverflow
Solution 37 - GithubShawn TayView Answer on Stackoverflow
Solution 38 - GithubdoubledherinView Answer on Stackoverflow
Solution 39 - Githubuser14073243View Answer on Stackoverflow
Solution 40 - GithubCodingBatView Answer on Stackoverflow
Solution 41 - GithubKushalSethView Answer on Stackoverflow
Solution 42 - GithubOleksaView Answer on Stackoverflow