You can host your website without purchasing a domain name. This is possible using GitHub pages. For this, just create a new repository with your username.github.io and run .html file using this URL. Follow following steps to host your website using GitHub pages.
- create github.io repository to host your website. Without this, hosting is not possible
Type your username not me 😛
2. Now add demo.html file to check whether your https://manpreet9112.github.io/ link is working or not.
3. If working then Done.
Now host website using domain that you have created https://manpreet9112.github.io/
Firstly create another branch (gh-pages) of your existing repository which you want to host
- Goto settings.
- click on Launch automatic page generator.
- click on continue to layout.
- Select the theme of your website.
- Now branch name gh-pages is created this will contain all files of your master branch.
Another way to host website via terminal.
Add new branch to existing repository
git checkout gh-pages
push changes to github
git add -Agit commit -m "Adding pages