深`秋

Coding and Thinking
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

git-page的使用

Posted on 2016-05-13 16:31  深`秋  阅读(1647)  评论(0)    收藏  举报

1.还是登录github,创建repository,假设名为test

2.repository-->settings-->lanuch automatic page generator,随便选一个layouts  ,  publish pages.这时得到一个网址,类似这个,http://xxx/github.io/test ,并且可以访问到。

3.cd到你要存放的项目文件的目录

4.输入命令  git clone https://github.com/xxx/test.git克隆项目到本地文件夹

5.cd到test  git checkout -b gh-pages origin/gh-pages,在本地新建远程分支的镜像(此时模板文件将全部复制到本地文件夹中) 

6.git rm -rf . (删除所有原模板文件)

7.执行git add . 以及  git commit -m '备注' (删除源文件)

8.将自己的网页文件粘贴到文件夹中

9.执行 git add.  以及  git commit -m '备注'。( 提交添加的文件)

10. git push origin gh-pages

然后就ok啦~~~访问你的页面吧。http://xxx/github.io/test/index.html