Problem is my GitHub page do not update its content

只愿长相守 提交于 2019-11-30 07:50:59
janos

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

Tianyw

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.

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!

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.

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

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.

Bruce Wayne

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.

Try to push empty commit like this

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

Works like a charm for me every time.

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.

Riya Abraham

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.

coder

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 

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.

黄了之

The easiest way:

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

Take mine as example

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.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!