It's most of the people's problems that they want to host their webpage online for unlimited time without paying any penny for that and they can show their webpage to anyone in the world.
Hello guys this Shivam, today I am going to tell you that how you can host your webpage on GitHub pages for a lifetime. And you can also share links for your file to show your work.
There are two ways to host your webpage on GitHub.
First and simple way to host the website on GitHub.
1) Create your profile on GitHub if you have already created then create a new repository (Repository means a folder or Directory).
Give a preferred name to a new repository
Then It will ask Quick Setup - And it will ask you to create a new file or Upload an existing file choose any option as per your preference.
If you want to upload your existing file click on Upload an existing file. Drag your file in the appeared and then click on the Commit changes button
After uploading or creating your file goto the GitHub repository Setting And Scroll down. Till GitHub Pages option.
Click on Source and edit the below value from None to main. (Select main option there).
And it will refresh your Github setting page and again scroll till GitHub Pages you will get a message notification. our site is ready to be published at https://[your_account].github.io/[your_repo]/
I hope now you are able to publish your webpage on GitHub pages if you are still facing any problem comment in the below comment box.
The second way Host your website on GitHub using Github Desktop Application
For processing the second method you need to download GitHub for Desktop application from https://desktop.github.com/ or from google.
Open Github desktop application and click on File->New repository... option you can also use shortcode Ctrl+N
.
After that, you will get to see a pop like the below image and fill the important fields like Name, Description(optional), Local Path, and then click on Create repository.
Now you will see this type of interface in the GitHub desktop application.
Now you will get to see a new directory where you have to create GitHub repository after that paste your website files and folder in that directory. like the below image.
After that now open the GitHub desktop application's tab and now you will see it is showing changes, like the below image. And input some words in summary(required) and then click on Commit to main.
Last and finally action you have to do is Publish repository for that you can click on publish repository button which is on the right side of the GitHub application or you can use short-code Ctrl+P
. And It will ask you a name for the online repository name, and the description as already told you that description is optional and last and most important thing is that you need to unchecked Keep this code private option and finally click on Publish repository, work done.
You have uploaded your website on GitHub Successfully. A little step we have to do again go to setting- scroll download till- GitHub pages - change option for main, I have already made you understand in brief about this step in the first method.
GitHub pages Advantages
1. You can host and share your Project with anyone in the world with paying any rupee.
2. People can check out your project's syntax and ask you to fix the erros.
3. We can also give instruction to the people who are visiting to our GitHub pages repository by using readme file.
4. We can create unlimited repository(Projects) in the GitHub pages
5. GitHub also provide us GitHub for desktop application which help us work using GUI (Graphic User Interface).
GitHub pages Disadvantages
1. We can't host dynamic project on GitHub pages.
2. We need to install GitHub for Desktop application if we want to upload directory or full website
3. Anyone can read our project's source code
I could find only few disadvantages on the other hand GitHub is open source platform so we should appreciatte GitHub which has created a beatyful environment for the developers.
Tips :-If you don't have any live portfolio website no problem, Make your own portfolio website on the GitHub pages and share with the people.