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

singhshemona

Shemona Singh

Posted on December 5, 2020

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

💖 💪 🙅 🚩
singhshemona
Shemona Singh

Posted on December 5, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related