Hosting Your Website on Github

Hosting Your Website on Github


2 min read

Most beginners in web development face the issue of creating websites but unable to host it or display on the web. That's were GITHUB comes in YAY!!!

In simple terms , Github is a platform to host your website. Also,gitHub is a highly used software that is typically used for version control. It is helpful when more than just one person is working on a project. Say for example, a software developer team wants to build a website and everyone has to update their codes simultaneously while working on the project. In this case, Github helps them to build a centralized repository where everyone can upload, edit, and manage the code files. Let's get started

  • Open a github account

login page.png

  • Creating a new repository for the website

A repository is like a folder for your project. Your project's repository contains all of your project's files and stores each file's revision history.

Screenshot_2020-07-27 Abiola-Farounbi - Overview.png

  • Fill in the name of the repository and add description about the website

Screenshot_2020-07-27 Build software better, together(1).png

Yay !!! , Our repository has been created. Screenshot_2020-07-27 Abiola-Farounbi MyFirstWebsite(1).png

  • Now to add the files to the repository Using the option 1 ,navigate directory or folder of the project using the command line


After navigating to the path of the directory,then follow the instructions from option 1


Note- since we adding files , we are going to use

git add .

To enable us to add all the files in the folder Go back to the Repository, the files would have been added

Screenshot_2020-07-27 Abiola-Farounbi MyFirstWebsite(2).png

- Using Github Pages

You can host a static website(Websites built with HTML) on GitHub pages free of charge, with deploys straight from Git.

Make sure you save your main html document as ' index.html'

Follow this Steps

  1. Go to the settings of your repo Screenshot_2020-07-27 Abiola-Farounbi MyFirstWebsite(3).png

  2. Scroll down to github pages and change the source to master branch. After the page reloads, Screenshot_2020-07-27 Abiola-Farounbi MyFirstWebsite(4).png

  3. Click on the link provided and viola !!!
    Screenshot_2020-07-27 MY FIRST WEBSITE.png

So with this you can create websites and display it on the web easily . If you face any issues,feel free to leave a comment below.