0% found this document useful (0 votes)
99 views

Hosting Website Github

This document provides instructions for hosting a website using GitHub pages. It explains that websites are hosted on servers and accessed via a domain name or URL. GitHub can host websites for free using GitHub pages by storing website files in a GitHub repository. The steps include creating a repository, uploading HTML files including an index.html file, configuring GitHub pages to use the main branch as the source, and accessing the hosted website using the provided URL. Files can be reuploaded to the same repository to update the hosted website.

Uploaded by

naaz
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views

Hosting Website Github

This document provides instructions for hosting a website using GitHub pages. It explains that websites are hosted on servers and accessed via a domain name or URL. GitHub can host websites for free using GitHub pages by storing website files in a GitHub repository. The steps include creating a repository, uploading HTML files including an index.html file, configuring GitHub pages to use the main branch as the source, and accessing the hosted website using the provided URL. Files can be reuploaded to the same repository to update the hosted website.

Uploaded by

naaz
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Hosting Website-GitHub

Updated automatically every 5 minutes


Websites are hosted or stored on special computers called servers. When Internet
users want to view your website, all they need to do is type your website address or
domain into their browser. Their computer will then connect to your server and your
web pages will be delivered to them through the browser.
Most hosting companies require that you own your domain in order to host with them
like www.harrypotter.com. You will need to purchase a domain name like this, but we
can still host our website using another tool without a domain name.
We will store our website on GitHub and then we will host our website pages from a
GitHub repository.
Watch this video for a better understanding.
Steps to host a Website:

1. Ensure that your website’s starting page is named index.html.


2. Open https://github.com/ and sign up for GitHub. If you already have an
account you can sign in to GitHub.
3. Click on New button and create a repository.
4. Then click on the Create repository button.
5. Click on “Uploading an existing file” and then choose your respective
project file.

 Make sure your project files contain the main file with the name
of “index.html”.

6. After selecting files click on the “Commit changes” button.


7. After uploading files successfully, to host your project, go to
the settings option in the same repository.
8. Click the Settings button as shown below.
9. Scroll down and go to the “GitHub Pages” section.
10. Change Source option from “None” to “main”.

Then press save Button


11. After completing the above step, you will see a link displayed in
the “GitHub Pages” section. When you click on that, you will be
redirected to your website’s home page.
12. This means your website is hosted now publicly. You can share the
same link with others so they will also be able to see your website.

Note: Sometimes after link generation, you have to wait for 3-5 mins to see
your website. It may give an error of this kind, so please be patient.

Reuploading Files
To update your code for the website you can upload files again to the same
repository and your website will be updated. The URL will not change.

1. Login to https://github.com/
2. Then on the left hand side of the page you will find a list of the projects
of yours. So open the project for which you want to update the files
3. Then for uploading files click on Add file option and select upload files
option.
4. After selecting files click on the commit changes button. And then you
can see your new files get updated in the existing repository.
After you have re-uploaded any files, and when you are checking the output,
do a HARD REFRESH OR open the website link in the Incognito tab.

13. If you need to keep an existing website as is, create a new repository
and follow from step 1.

Published by Google Drive–Report Abuse

You might also like