问题
I've been following this instructions
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?
回答1:
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...
回答2:
I fixed this problem.
you can try to go to the setting page.
I go into the project setting page ,and found Github pages give me some message "some syntax error", I fixed it, and ok.
回答3:
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!
回答4:
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.
回答5:
Try to push empty commit like this
$ git commit --allow-empty -m "Empty commit"
Works like a charm for me every time.
回答6:
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
andnode_modules
directories by default https://github.com/blog/2277-what-s-new-in-github-pages-with-jekyll-3-3
回答7:
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.
回答8:
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.
回答9:
To solve this issue
- Switch your current Github Pages branch to some other branch and click
on
Save
- Switch back to your desirable Github Pages branch and click on
Save
.
This will force Github to update your changes.
回答10:
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.
回答11:
I am a novice and please allow me to answer with tears. Please go to settings at your repository, scroll down to 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.
回答12:
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).
回答13:
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
回答14:
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.
回答15:
The easiest way:
Settings -> Braches -> choose "gh-pages" -> UPDATE.
Take mine as example
回答16:
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.
回答17:
Just clear browser's cache. ctrl + shift + r for Chrome, as example
来源:https://stackoverflow.com/questions/24713112/problem-is-my-github-page-do-not-update-its-content