注意: 这篇文章假设你有GitHub账号以及了解基本的Git知识
页面访问地址: http://username.github.io/repository/
// 拉取远程仓库至本地
git clone https://github.com/user/repository.git
// 打开本地仓库
cd repository
git checkout --orphan gh-pages
// 如果你想要创建完全独立的页面可以执行:
git rm -rf .
git commit -a -m "Adding pages"
git push origin gh-pages
如果你使用一级域名作为自定义域名:
- 在gh-pages新建CNAME文件,格式为: yoursite.com
- 添加A Record 并指向IP 204.232.175.78
如果你使用子域名作为自定义域名:
- 在gh-pages新建CNAME文件,格式为: sub.yoursite.com
- 添加新 CNAME record 指向 username.github.io