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?
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?
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:
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.
disable cache
in network tab in dev tools didn't work, but right clicking the reload button and choosing empty cache and reload
worked –
Nardone 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...
error: unable to delete 'gh-pages': remote ref does not exist error: failed to push some refs to
–
Loading error: unable to delete 'gh-pages': remote ref does not exist error: failed to push some refs to
" may need to go to setting in github and change this Default Branch(left hand side Branch tab), to another branch first. Or create Master branch in github and set it as default. –
Budd git push origin :gh-pages
, then wait until the page returns 404, then git push origin gh-pages
. That is, assuming gh-pages
is the branch used for GH Pages - which is the default. –
Antonioantonius 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!
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.
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
Save
Save
.This will force Github to update your changes.
Settings > Pages > Source
, and select and save the desired branch. I named mine "switchable" for future use. For creating a new branch on GitHub, go to your repo's code tab, and open the "Switch branches or tags" button, then enter the name for your new branch, and click on the "create..." appearing text. –
Latreese 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
docs
subdirectory of the branch to host the page, and I needed a .nojekyll
in there also, not just the root of the branch. Thanks for this. –
Noninterference 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.
Press ctrl+F5 to re-download cached content.
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.
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.
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).
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,
<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='expires' content='0'>
<meta http-equiv='pragma' content='no-cache'>
git push origin :gh-pages
. This will delete the gh-pages branch.npm run deploy
. This will re-build your app and re-create gh-pages branch
with updated content.I hope this helps! Let me know if it worked for you as well in the comment section, cheers!
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.
If your page was online, but after update no changes visible:
1: Change repository to private
2: Change back to public
3: Enable "GitHub Page" function again
For those who find solutions above not useful try this:
Worked for me.
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
gh-pages
branch is related to their master
branch like this; in fact, Github suggests creating gh-pages
as an orphan branch if you aren't using Jekyll. –
Microcline error: pathspec 'gh-pages' did not match any file(s) known to git.
–
Loading 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.
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.
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
If you're using the gh-pages
command you may need to delete the gh-pages
cache at node_modules/gh-pages/.cache
The issue is being caused because of the browser caching the page. Open the git link in incognito mode.
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.
A couple have mentioned looking for error messages in Settings->Pages, but a better place to look is the stdout of the jekyll build workflow under the About tab. In either case, an error message of any sort is best to have in hand before starting on any of the other 26 answers given above.
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 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.
This can happen for various reasons. My issue was that the condition that was tested for during the deploy
step didn't match the triggering branch. I had used another script as a model, and it had been trigger from pushes to main
. I changed the on: push:
at the top to my desired branch, but didn't notice the conditional, so it stayed referencing main
name: Deploy stuff to Pages
on:
push:
branches:
- other-branch # <---- this is my trigger branch
jobs:
build:
name: Build
steps:
# build steps here
deploy:
name: Deploy
needs: build
if: github.ref == 'refs/heads/other-branch' # <---- needs to match, was previously 'main'
steps:
# deploy steps here
```
Perhaps it's because of errors in one of your codes. That was my case, I saw a red "X" at the left of the commit ID. It won't update your page until the commit has no errors. It has to be a green check at the left of your commit. If you have a red "X" click on it and see the errors you have. solve them and the page will update after you commit without errors.
I show the image below depicting what you need to see (a green check, no errors):
in github pages: in that place we choose the name of our branch ex."main" github give us another option this is "None" choose it and save. after that repeat choose your branch again ex."main" and save wait for afew seconed and update your page it is work with me.for explain
Just clear browser's cache. ctrl + shift + r for Chrome, as example
Nothing to worry, to Update your git react code rebuild code by using command
npm run deploy
react code will updated to gh-pages
© 2022 - 2024 — McMap. All rights reserved.
gh-pages
branch? Only that branch will be rendered to the GitHub page… (And that might take up to 10 minutes) – Pampasgh-pages
. According to official document,gh-pages
is used for project site only, and user site like blog is supposed to usemaster
. – Ruff