In previous GitHub tutorial post I shared tutorials about common uses of GitHub and How to host Web Pages on GitHub in 5 Minute , now it's turn to know something advance which can helps you a lot.
If you are a web developer and Running various blog hosted on WordPress or BlogSpot then sure some times you need to share your dummy content or development to users as demo, but because of hosting related issue may be you are getting trouble.
GitHub Pages best alternative for Free and Public html content, it's also can be hosted with your own domain.
In last post I shared how to Create GitHub Pages for your domain but now I'm going to share how to upload content on GitHub Pages sub directory and Add Your Demo Content On GitHub Pages.
First you should go to GitHub.com and Create New Repository kindly follow this tutorial for basic reference.
Once repository created simply clone it on you desktop.
git clone your_repository_url.git
once clone completed enter clone directory using below command.
Now paste your content (Html, Css, Js etc.) here and follow below steps.
Add your content using below command
git add .
Create a gh-pages branch
git checkout --orphan gh-pages
Commit your work
git commit -m "Project Done"
Push content on GitHub pages
git push origin gh-pages
Now you can check your site http(s)://<username>.github.io/<projectname>