Github offers Github Pages that let you host web pages on Github.
You create these by adding a branch to git called gh-pages
, and this is often in addition to the default branch master
.
I just needed the gh-pages
branch. So thanks to YJL, here’s the simplest way to do it.
- Create the repositoryon github.
- Create your local repository and
git commit
into it. - Type
git push -u origin master:gh-pages
- In
.git/config
, under the[remote "origin"]
section, addpush = +refs/heads/master:refs/heads/gh-pages
The magic is the last :gh-pages.