Create free website using Github

GitHub provides a very good platform to keep our repositories, modify and control them in an organised way. It also enables us to create free website of our own with a domain ".github.io".

All you need is an HTML template which can be downloaded for free based on your requirement(blog, wedding website, etc) or a code which is capable of displaying a webpage.

Steps to create free website on GitHub -

  • Signup or Login on Github and create a repository with a name "github.io".
  • Note the username you choose will be the title of your website.
  • When an empty repo is created, copy the https URL by clicking the "Clone or download" button on the right.
  • Use the HTTPS link and clone this repo on your local machine by typing the below command in your terminal.
$ git clone <clone url>
  • Download the template and copy all the files in the cloned directory created above.
cp -r template_dir/* <cloned_dir>/
  • Add the files in git and push it to the Github(web repo created in step 1) with the below command.
# add all files to local git
$ git add -A

#commit the files with a message.
$ git commit -a -m "Initial commit"

# Push all the changes to the repo present on github url.
$ git push
  • git push might ask for a username and password to push the files to your repo.
  • Check your repo on web if all files are present.
  • Navigate to https://www.<git-username>.github.io and your website is ready to be displayed across the web :-).