Abstract:如何把网站托管在GitHub上并能实时预览?本文是Solution ~
利用GitHub Pages托管网站
1.在GitHub上Create a repository
2.Clone the repository to local
1 | git clone https://github.com/username/username.github.io |
3.Enter the project folder and add an index.html
1 | cd username.github.io |
4.Push it
1 | git add --all |
或者:
3.创建1个gh-pages分支
1 | git checkout -b gh-pages |
4.编辑相应的html/css/js文件,放在gh-pages分支上
5.push gh-pages分支到GitHub上
1 | git add <filename> |
预览网站
在项目源代码页面链接前缀那加上http://htmlpreview.github.com/?即可,譬如:
Example
自己最近做的毛概作业(给毛爷爷做个简历,于是我就做了个网站…):毛爷爷的个人简历网站