Basically, static sites and project websites are hosted with github. If you want to host any blog sites then you can do with Jekyll too. Check my other posts for Jekyll.
To host any site, I am explaining here from Linux platform, you can use same method for windows too. follow these steps:
You can watch this video or follow the instructions below.
- login to your github account and create a new repository
- in terminal navigate to your website’s folder (where index.html is located)
- run the following github commands:
- now lets add the remote origin from github
** replace lakshmanbasnet with your username ** replace test.git with your repository name
the default branch is master, for hosting websites with Github we need to push our files to gh-pages branch. Remember you need to push to this branch since any files pushed to master branch won’t be generated for websites, if you push to gh-pages branch, github will automatically generate website for you.
lets make new branch gh-pages with command:
- lets navigate to our gh-pages branch
- now every thing is ready, just hit push command and enter your credentials when asked
after you have pushed your file to github repo, goto your github repo in your browser
in settings scroll down to find the link for your website, the link will be something like https://lakshmanbasnet.github.io/test/
congratulations your site is live now
to make any changes to the website, you need to push the files from your computer to github by following commands:
To add custom domain name to replace the default domain name provided by github check my next post.
Thanks! Enjoy free hosting!! ;)
Like, comment and Share if I worth :P
Posts you might like
Didn't get reset email to change wordpress password? No access to phypadmin? Follow this one simple step to reset your wordpress admin password. read more
Because of some reasons, your website might be slower than it should be. Here is how to fix connecting to gc.kis.v2.scr.kaspersky-labs.com js request injection. read more
Learn to blog like hacker, Jekyll tutorials from basic installation to deployment, and more advanced stuffs too. read more
Pointing .np domain to Github page website, Jekyll Website, gh-pages. register.mos.com.np doesn't allow you to add A records to point to Github so here is the most easiest way how... read more
Get a free .me domain name in easiest manner from Github Developer Pack. Also with this pack, you will be getting a lot of tools and freebies worthing so much.... read more