github GitHub Pages Using Git to create pages from scratch


Example

  1. Create a new repository or clone an existing one.
  2. Create a new branch called gh-pages without any history
$ git checkout --orphan gh-pages

# ensure you are in the correct directory then,
# remove all files from the old working tree
$ git rm -rf
  1. Add an index.html file to the root of the repository.
$ echo "Hello World" > index.html
$ git add index.html
$ git commit -a -m "First pages commit"
  1. Push to Github.
$ git push origin gh-pages

You can now load your new Github Pages site at http(s)://<username>.github.io/<projectname>