Publish with GitHub Pages

Actually putting your site on the web where anyone can see it is called publishing your site. This post describes how to publish a site using GitHub Pages. Pages are a free feature of public GitHub repositories and a great way to host a basic site. Free web hosting through GitHub!

1. Click on the Settings link from your repository’s home page.

  1. First make sure you have created your repository on GitHub. If you don’t have a repository or there are no files in it, this won’t work.
  2. You will also need to be signed-in to GitHub to complete this process.
  3. Go to your repository on GitHub.
  4. Click on Settings
screenshot showing where to click Settings tab in the repository

2. Click on the Pages tab of Settings

It is in the left vertical nav.

screenshot showing where to click Pages tab in Settings

3. Select a Source Branch for your Pages

Click the Select Source dropdown and choose the main branch.

screenshot showing selecting a branch to publish in GitHub pages settings

4. Save Your Changes

Click the Save Button.

On a side note, DO NOT use the Theme Chooser. This is a special way of using GitHub pages that does not just publish the pages you have in your repository.

Screenshot showing where to click the Save button - and not the choose a theme button.

5. Changes are Saved

When you save the changes the page will reload and you will get a message saying your site is ready to be published with a link.

screenshot showing text on GitHub Pages settings that read "Your site is ready to be published at"

Note that at this time your site won’t be live yet. If you follow the link now you will get a 404 page.

screenshot of 404 page that shows when GitHub Pages is not done publishing

6. When your site is ready

When GitHub has published your site and it can be seen, the background color of the message will change from blue to green and the text will change to read that your site is published

screenshot showing text on GitHub Pages settings changed to read "your site is published at"

Your GitHub Pages link will now be the link shown. You can give this link to anyone or put it in your portfolio.

Click the link to see your site

screenshot of site after publishing through GitHub Pages

NOTE: There are a few reasons you might not see anything when you click the link.

  • It may take a few minutes for your pages to be published and for the link to be active.
  • If you don’t have a file named index.html in the root of your repository (and it must be at the top level, not in any sub folders), then you will not see anything.

1 comment

Leave a comment