Website setup

Instructions on how to host your Hugo website on Github. The website URL will be, where username is your Github username. These instructions are based on this blog post (You can also consult this, although I think it is unnecessary.)

  1. On Github, create repository called
  2. Locally, do the following:

    echo "#" >>
    git init
    git add
    git commit -m "first commit"
    git remote add origin
    git push -u origin master
  3. Create a new branch called “hugo”: git checkout -b hugo

  4. Put in this “hugo” branch all the source files for your website.

  5. Generate website: type hugo, this creates a “public” folder

  6. Download, put it together with other files in the hugo branch.

  7. Push this branch:

    git add --all
    git commit -m "first hugo branch commit"
    git push origin hugo
  8. Go to Github, make “hugo” the default branch. In the repository website, you will see now “2 branches”, click on it. Click on “Change default branch”, and choose “sources”, then update.

  9. Execute setup script (bash, still in hugo branch.

  10. To make sure that “hugo” branch is in sync with “origin” (i.e. Github), repeat step 7.

  11. Download and execute it (bash

  12. That’s it. Now make changes to your website and see if running updates your website properly. Remember to run step number 7 before you do so.