DEV Community

Shemona Singh
Shemona Singh

Posted on

How to Fix "Only the Readme Is Appearing" When You've Deployed to Github Pages

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:

  1. 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.
  2. Go to your terminal of choice. cd into your project directory. Ensure you're on the master branch (or whatever is your root branch). Run npm 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)

Collapse
 
ritika168 profile image
ritika168

Refreshing it hard worked for me, thank you!

Collapse
 
singhshemona profile image
Shemona Singh

So happy to hear that! :)

Collapse
 
yousefkhalidiq profile image
Yousef Khalid

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?

Collapse
 
singhshemona profile image
Shemona Singh

Hi Yousef! Apologies for the late response, were you able to figure out the issue?

Collapse
 
solodev profile image
soloDev

thanks for the post....
after i did that i get a blank page now..... do you know why it do that?

Collapse
 
singhshemona profile image
Shemona Singh

Hey Salomon - have you tried inspecting the page? Are you getting any errors in the console?