How to publish a site on GitHub Pages 2022

Github is not just publishing your projects and sharing them with others but it also offers you can host your website – Html, reactjs.

This article will discuss hosting your website on GitHub using Vs Code.

Note: If you do not have git installed in your system then install it..

How to publish a site on GitHub Pages 2022
https://git-scm.com/

1. Create a Github Account

How to publish a site on GitHub Pages 2022
In the input box enter your email address and click on Sign up for Github and set your Name and Password.

2. Download GitHub Desktop

How to publish a site on GitHub Pages 2022
Download GitHub Desktop as per system configuration.

Open the download application and do the installation process.

Note: Config your GitHub Desktop with GitHub account.

Next, we’ll create a GitHub repository for the GitHub project.

3. Create a new Github Project(repository)

How to publish a site on GitHub Pages 2022
Click on the “New” button

In the below figure, When the “Create a New Repository”, fill in the “Repository Name” text input as:

username.github.io

Note: for hosting .github.io

How to publish a site on GitHub Pages 2022
fill in the repository name input box repo name.

After filling the repository name click on “Create repository”.

4. Clone GitHub repository

Clone GitHub repository on Local System through Github Desktop or Visual Studio.

How to publish a site on GitHub Pages 2022

When you click on the Open with GitHub Desktop button pop dialog will appear on your web browser. Click on “Open GitHubDesktop.exe”.

How to publish a site on GitHub Pages 2022

If you want to change Local Path then you have to choose a path.

How to publish a site on GitHub Pages 2022
Click on “Clone” button.

Open Project Folder.

How to publish a site on GitHub Pages 2022
Local Path

5. Copy your files to the new Repository folder

In the previous step, we created the GitHub Repository folder inside the /GitHub folder with the name, sauavhathi.github.io. So, this means the GitHub Repository folder should be located at /GitHub/sauavhathi.github.io.

Copy everything in your working folder (/html/mywebsite for example) into your GitHub Repository folder (/GitHub/sauavhathi.github.io).

The GitHub Desktop app should now look something like this:

How to publish a site on GitHub Pages 2022
“Commit” is located near the bottom left of the user interface – fill “My first commit!”.
How to publish a site on GitHub Pages 2022

After filling the commit input box click on Commit to master.

How to publish a site on GitHub Pages 2022

Now that our files are committed, this allows us to push our commit to GitHub!

6. Publish Your Site

Now, in your browser, go to your new GitHub repository page.

How to publish a site on GitHub Pages 2022
A new index.html file was added to the project folder.

Click on Settings that appear on the right side. Publish your site GitHub Pages is designed to host your personal, organization, or project pages from a GitHub repository.

How to publish a site on GitHub Pages 2022

Pages section is located near the bottom left of the user interface. Select master Brach from Source and Save it.

How to publish a site on GitHub Pages 2022

Now your GitHub site is ready 🎉

How to publish a site on GitHub Pages 2022

Note: The Html index.html file name must be in lowercase.

How to publish a site on GitHub Pages 2022

Happy Learning – If you require any further information, feel free to contact me.

How to publish a site on github?

1. Create a Github Account
2. Download GitHub Desktop
3. Create a new Github Project(repository)
4. Clone GitHub repository
5. Copy your files to the new Repository folder
6. Publish Your Site

Can i host wordpress site on github?

Yes

How to put a website on github?

1. Create a Github Account
2. Download GitHub Desktop
3. Create a new Github Project(repository)
4. Clone GitHub repository
5. Copy your files to the new Repository folder
6. Publish Your Site

is github good for beginners?

Yes

how to host site on github?

1. Create a Github Account
2. Download GitHub Desktop
3. Create a new Github Project(repository)
4. Clone GitHub repository
5. Copy your files to the new Repository folder
6. Publish Your Site

how to upload site on github?

1. Create a Github Account
2. Download GitHub Desktop
3. Create a new Github Project(repository)
4. Clone GitHub repository
5. Copy your files to the new Repository folder
6. Publish Your Site

github your site is published 404?

in your project root, the folder must be an index.html file.

Is GitHub for free?

yes

What is GitHub best known for?

sharing projects with others.

Share your love
Saurav Hathi

Saurav Hathi

I'm currently studying Bachelor of Computer Science at Lovely Professional University in Punjab.

📌 Nodejs and Android 😎
📌 Java

Articles: 444

Leave a Reply

Your email address will not be published. Required fields are marked *