So, you've just deployed a site with Github pages. But when you go to the url (https://repo-name-here.github.io/
), you're only seeing the ReadMe. Where's all your work?
You need to do two things:
- Go to the settings page of the corresponding Github repo. Scroll down to the section titled GitHub Pages. Where it says source, change the branch to be
gh-pages
and the folder to be/(root)
. Hit save. - Go to your terminal of choice.
cd
into your project directory. Ensure you're on the master branch (or whatever is your root branch). Runnpm run deploy
.
Go to your project url and hard refresh (cmd/control
+ shift
+ r
). If you don't see your website, give it a few minutes to update.
Note: adding/committing/pushing does not update what you see at the url of your site, it only updates the repo history on Github. If you want to actually update your site, you must use
npm run deploy
- per the set up described in this helpful tutorial.
Hope this helps. I've ran into this annoyance twice, so I thought it was worth sharing for anyone else in this dilemma. 😊
Top comments (6)
Refreshing it hard worked for me, thank you!
So happy to hear that! :)
Hey Shemona, when i try to change the branch I only have the main branch as an option, how can i add the (gh-pages) as a branch?
Hi Yousef! Apologies for the late response, were you able to figure out the issue?
thanks for the post....
after i did that i get a blank page now..... do you know why it do that?
Hey Salomon - have you tried inspecting the page? Are you getting any errors in the console?