Why does my GitHub page do not update its content?

GithubGithub Pages

Github Problem Overview


I've been following the official guide @ pages.github.com

So far I've created the local repo and pushed it to GitHub, but, whatever change I do, I can see it in my repo at GitHub but not in my GitHub page. How is that possible?

Github Solutions


Solution 1 - Github

A bit late to the party but I just had this issue and my solution isn't covered by any of the above.

Specifically my issue was the following:

  • I had created a github.pages site with a custom domain.
  • I was pushing commits to the correct GitHub branch but not seeing the updates on the github.pages site.

Solution: The issue turned out to be my browser caching the page (despite my having page caching disabled). To fix it I just cleared my cached data from the past hour and that worked instantly.

To clear the cache data in Chrome go to the Chrome menu then More Tools > Clear Browsing Data.

I don't know what caused the caching, this github.pages/custom domain combo is the only thing that has ever caused it for me.

Solution 2 - Github

Sometimes this happens to me too: after creating and pushing the gh-pages, the GitHub Pages page is missing or not getting updated. Even if I commit more changes to the branch and push it again, it won't update on GitHub pages.

If I remember correctly, I solve this by deleting the branch from the server and pushing it again:

git push origin :gh-pages
git push origin gh-pages

I might have to add some dummy commits and push again to trigger the update, I don't remember exactly...

Solution 3 - Github

I had the same issue.

The problem was that my website was publishing from the gh-pages branch, but I was pushing my recent changes to the master branch.

Check which branch Github is publishing your website from. In your repository, click on Settings, scroll down the page and there should be a box where you you can change the publishing branch.

It should look like this:

More info is here

Also if you are using a custom domain name, make sure your CNAME file is up to date.

Hope that helps!

Solution 4 - Github

I fixed this problem.

you can try to go to the setting page.

I go into the project settings page (.../settings/pages) ,and found Github pages give me some message "some syntax error", I fixed it, and ok.

Solution 5 - Github

Try to push empty commit like this

$ git commit --allow-empty -m "Empty commit"

Works like a charm for me every time.

Solution 6 - Github

To solve this issue

  1. Switch your current Github Pages branch to some other branch and click on Save
  2. Switch back to your desirable Github Pages branch and click on Save.

This will force Github to update your changes.

Solution 7 - Github

Experienced this problem when a filename contained the word "vendor" ex.:vendor.bundle.20d44fcf5147c6ed68a3.js

Adding an empty file named .nojekyll in the root of the repository fixed the issue. > Jekyll now ignores the vendor and node_modules directories by default https://github.com/blog/2277-what-s-new-in-github-pages-with-jekyll-3-3

Solution 8 - Github

I am a novice and please allow me to answer with tears. Please go to settings at your repository, scroll down to enter image description here to check WHETHER THERE IS A PROBLEM with your current webpage. If there is a problem, your site WILL NOT BE UPDATED. I think it's a protection mechanism or something.

This morning I deleted and moved some of the files in repository, I have updated many times and it still remains on previous version, even I checked the index.html has indeed updated. Later I shut down the whole repository and started new one, inserting items one by one, but still met the problem. I tried new branch like gh-pages, I think it is not necessary for a beginner like me. Later I checked my settings and found the notification, I deleted the problematic files and it worked instantly. Were I knew the problem I would not have been so stupid to shut down it forever. I miss my old git records. Guess every lesson takes a price, Github is no exception.

Solution 9 - Github

I tried Janos' answer but it didn't work for me.

I made a slight change to my index.html file (something insignificant) and pushed to the gh-pages branch again. I tried opening the page in a different browser and it worked. My original browser updated the page too although I don't think it's a browser cache issue.

I rebased master with gh-pages locally and pushed that as well, not sure if that makes any difference.

Solution 10 - Github

Try to disable GitHub pages, and enable it after a few minutes. I tried. This works. But It takes some time to update and re-enable GitHub Pages.

Solution 11 - Github

This answer is for those who have created their app with create-react-app.

It took me days to finally find the answer for react-gh-pages not updating. I hope the following answer helps as it did for me. It is a combination of multiple answers that I have researched over:

The main and most common reason is your browsers caching feature. In order to disable it for every rendering of your index.html,

  1. Add this snippet in your index.html file under the public folder.

<meta http-equiv='cache-control' content='no-cache'> 
<meta http-equiv='expires' content='0'> 
<meta http-equiv='pragma' content='no-cache'>

  1. Push any new changes to the master or main branch(not to the origin gh-pages).
  2. By now your master branch is updated.
  3. Now run: git push origin :gh-pages. This will delete the gh-pages branch.
  4. Run: npm run deploy. This will re-build your app and re-create gh-pages branch with updated content.
  5. Now go the settings section on the top-right side of your app repo page. Scroll down to the bottom. Under Github Pages section, under source, there is branch section. Change that to your master branch or main. Keep the root folder as it is.
  6. Go to your site and you will see a Readme file. It may take some time. After a minute or so change the branch back to gh-pages. After a minute visit your site and it should be updated by now.

I hope this helps! Let me know if it worked for you as well in the comment section, cheers!

Solution 12 - Github

Press ctrl+F5 to re-download cached content.

Solution 13 - Github

I recently had an issue where my github pages hosted site wasn't updating from an old branch push in master. I was able to see the new changes by going to domain.com. (the dot at the end is important), and also hard refreshing would show the new changes, but with a regular refresh, it would show the old site and the old JS files too.

My problem seemed to only be in Chrome, which is where I was developing the site. For full disclosure, the old changes were in React and hosted in Netlify. The new changes that I was trying to get to push and display were static files hosted in github pages.

THE FIX (in Chrome): devtools > Application > clear site data (button).

Solution 14 - Github

I had the same problem everything is up to date in my repository but it still wasn't loading to my github page, so without making any further changes, I tried to add, commit and pull.

I fixed it with another git commit, and git pull again. Now the changes are loaded to my git.

Solution 15 - Github

The issue is being caused because of the browser caching the page. Open the git link in incognito mode.

Solution 16 - Github

If your GitHub pages repo is private AND you have recently downgraded to GitHub Free, this might apply:

> Your subscription, GitHub Free, does not support GitHub Pages sites > for private repositories. After we introduced free private > repositories in January, we found a limited number of sites connected > to private repositories were mistakenly left active. If you’d like to > keep updating this site, you can make its repository public or upgrade > to GitHub Pro. You can also unpublish it below. This site is using a > custom CNAME: Secure your domain name before unpublishing this site.

Solution 17 - Github

Here is what worked for me:

First Step (update your master):

git add . 

git status                # to see the changes to be committed

git commit -m "comments"

git push origin master

Second Step (Update gh-pages):

git-checkout gh-pages     # going to the gh-pages branch

git rebase master         # sync gh-pages with master 

git push origin gh-pages  # commit changes to gh-pages

git checkout master       # return to the master 

Solution 18 - Github

After making changes in your script, go down to the commit changes section. There you'll find one input box and one text-area. As you all know filling those boxes is not mandatory, but they are there for a reason. So, next time before clicking on the commit changes button give this a try >> make sure that you write something in the first input box (you can leave the text-area empty), and what you write is different from what you wrote for your last commit for the same file. In this way github will be able to distinguish between the current script and the updated one, and the change should be reflected almost instantly.

Hope that helps.

Solution 19 - Github

The easiest way:

>Settings -> Braches -> choose "gh-pages" -> UPDATE.

Take mine as example

Solution 20 - Github

In my case, it helped to run:

npm run deploy

I did it after pushing the master branch to GitHub. I needed to wait a bit until the changes were visible on my page. But it did work without changing any settings.

Solution 21 - Github

In case this helps someone else...

For me the issue was the content in the branch was being updated, but the filenames did not change, so browser was retrieving cached content.

I'm using Angular CLI with angular-cli-ghpages. Setting the configuration to production appends hashes after each file in the build forcing the browser to retrieve the new content.

sample deploy script:

ng build --configuration=production --base-href \"<repo-name>\" && ngh

If you don't want a production build, you can also specify output hashing in other build configurations in angular.json

Solution 22 - Github

If you're using the gh-pages command you may need to delete the gh-pages cache at node_modules/gh-pages/.cache

Solution 23 - Github

The problem is caused due to browser caching the page. Disable browser caching with meta HTML tags. Add the following in _layouts/default.html

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />

> WARNING: After this any browser supporting Cache-Control will not store any of your cookies or files.

Solution 24 - Github

I reflect my changes in my deployed GitHub repository after committing locally, by renaming my gh-pages branch to master and unpublishing my GitHub Page, and then re-name the branch to gh-pages and then publish it again; then it works.

Solution 25 - Github

Just clear browser's cache. ctrl + shift + r for Chrome, as example

Solution 26 - Github

Well all you have to do is to run the following command:

> npm run deploy

It will automatically update the gh-pages

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
Questionuser3219369View Question on Stackoverflow
Solution 1 - GithubJoshView Answer on Stackoverflow
Solution 2 - GithubjanosView Answer on Stackoverflow
Solution 3 - Githubuser6929107View Answer on Stackoverflow
Solution 4 - GithubTianywView Answer on Stackoverflow
Solution 5 - GithubNedim MemiševićView Answer on Stackoverflow
Solution 6 - GithubmechaniciousView Answer on Stackoverflow
Solution 7 - GithubTim ScholtenView Answer on Stackoverflow
Solution 8 - GithubPistachio GuoguoView Answer on Stackoverflow
Solution 9 - GithubSriniView Answer on Stackoverflow
Solution 10 - GithubTheMisirView Answer on Stackoverflow
Solution 11 - GithubDorji TsheringView Answer on Stackoverflow
Solution 12 - GithubentroookView Answer on Stackoverflow
Solution 13 - GithubAdam CulpepperView Answer on Stackoverflow
Solution 14 - GithubRiya AbrahamView Answer on Stackoverflow
Solution 15 - GithubYashwant Kumar SahuView Answer on Stackoverflow
Solution 16 - GithubYiannisView Answer on Stackoverflow
Solution 17 - GithubcoderView Answer on Stackoverflow
Solution 18 - GithubSubham SahaView Answer on Stackoverflow
Solution 19 - GithubLenaView Answer on Stackoverflow
Solution 20 - GithubsnikerslalaView Answer on Stackoverflow
Solution 21 - GithubSteveView Answer on Stackoverflow
Solution 22 - GithubdoubledherinView Answer on Stackoverflow
Solution 23 - GithubSoubhik BiswasView Answer on Stackoverflow
Solution 24 - GithubDaud AhmadView Answer on Stackoverflow
Solution 25 - GithubДанил ДавыдовView Answer on Stackoverflow
Solution 26 - GithubShazil SattarView Answer on Stackoverflow