Hosting Jekyll Website on Github


Aster Hu


June 8, 2020

Github and jekyll

Before Setup

  1. Create a Github account
  2. Create a new Github repository
  3. Install Git on local

For MacOS, the easiest way is to install via homebrew

brew install git

Setup Github pages

cd to the website directory and run

git init                    #initialize a empty Git on local.
git checkout -b master      #switch to a new branch master
git status                  #display all files


git add .                                 #add the files
git commit -m "initial commit"

Here I got the message for Github username

*** Please tell me who you are.


git config –global “”

git config –global “Your Name”

to set your account’s default identity.

Follow the instruction and put the email address and my name.

git config --global ""
git config --global "githubusername"

Push Files to Github

Copy the git link from Github repository, and run

git remote add origin

git push origin master     #push all files to master branch

It asked me about the username and password on Github. Enter the credentials as instructed.

Username for ‘’:

Password for ‘’:

As per tutorial, the website should be published now (website link and status is under Settings on repository).

Mine got a 404 issue. Not sure why, but I managed to fix it thanks to Nycen.

git commit --allow-empty -m "Trigger rebuild"

Tadaa! Now the site is finally on live! I might grab some ice-cream for celebration

:icecream: ★,°:.☆( ̄▽ ̄)/:.°★

Anyways, whenever there’s a change on local, run the following code to push update to Github.

git add .
git commit -m "some commit messages"
git push origin master