Create an empty branch for your github page:
git checkout --orphan gh-pages
Commit at least one file to this branch and push it to GitHub.
Switch to your master branch.
Choose a subfolder name to link to your gh-pages branch, i.e. www
.
Add your gh-pages branch as subtree:
git subtree add --prefix=www origin gh-pages
Now, after committing changes within www
, run this command to sync your gh-pages branch:
git subtree push --prefix=www origin gh-pages
Browse to your instantly released site at <user>.github.io/<project>
.
Have phun.