Line
IT Knowledgebase
< All Topics
Print

How to Host a Website on GitHub

Step 1: The first step is to create a GitHub account if you don’t have one already. You can create an account for free on the GitHub website.
If you already have one then do GitHub login to your account.



Step 2: Next, you need to create a new repository to host your website. To create a new repository,
click on the “Create repository” button on your left section after the new registration.
You can also do it by clicking on the “new” button on your GitHub Dashboard.


Step 3:
Give your repository a name that corresponds to your username. For example, if your website is called “username”,
name your repository “username.github.io”. and then click on “create repository” button.

 

Step 4: To create a website, you need an HTML file that contains the content of your website.
You can create a new HTML file using a text editor like Visual Studio Code or Notepad.
Save the file as “index.html” in your local repository. Or Click on ”creating new file” or “new file” 
to create a new file and name the created file.


Step 5:
Name the file with the “.html” extension so that you can add the HTML code for your website.
Add the code for your website below in the edit section.



Step 6: Add a description and “Commit changes” button so that your code gets added and saved on GitHub.


Step 7:
Add the CSS code for your website by doing the same process as previous step,
and then add a description and click on the “Commit changes” button.


Step 8:
After pushing your code to your repository, you need to enable GitHub Pages for your repository.
To do this, navigate to your repository on GitHub and click on the “Settings” tab. Scroll down to the “Pages” section from the left section.


Step 9:
Once GitHub Pages are enabled for your repository, your website is now live!
You can visit your website by navigating to https://your-username.github.io/ in your web browser.
It might take a few moments for the changes to propagate and for your website to be accessible.

 

Credit : https://www.geeksforgeeks.org/how-to-host-a-website-on-github-for-free/

Messenger