使用 Git 从头开始创建页面

  1. 创建新存储库或克隆现有存储库。
  2. 创建一个名为 gh-pages 的新分支,没有任何历史记录
$ 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. 将 index.html 文件添加到存储库的根目录。
$ echo "Hello World" > index.html
$ git add index.html
$ git commit -a -m "First pages commit"
  1. 推送到 Github。
$ git push origin gh-pages

你现在可以在 http(s)://<username>.github.io/<projectname> 加载新的 Github Pages 站点