github有个特别实用的功能最近才知道,就是你在上面建立一个项目,他可以自动在上面按你的需要生成html页面,可以通过浏览器直接访问,原来我一些小东西的demo都是传到服务器上面,不仅麻烦 同步还是个问题,现在真是节省了我很多的时间。下面就是一个我项目自动生成的地址:
http://vikingmute.github.com/vtooltip/
下面我们就说说怎么样来生成 有两种方法 我推荐第二种直接用github提供的自动生成工具
将页面切换到你的项目首页 比如说https://github.com/vikingmute/vtooltip
然后点击这个admin按钮
然后勾选github pages的选项框

然后在弹出框里面点击 Automatic GitHub Page Generator
当这部分完成时 你就可以直接在浏览器里面看到你的页面了 这个就是地址格式http://{userid}.github.com/{project}
怎样修改这个页面的内容 只要在项目中checkout一个叫gh-pages的branch就可以了
$ cd Repos/ampere
$ git fetch origin
remote: Counting objects: 92, done.
remote: Compressing objects: 100% (63/63), done.
remote: Total 68 (delta 41), reused 0 (delta 0)
Unpacking objects: 100% (68/68), done.
From git@github.com:tekkub/ampere
* [new branch] gh-pages -> origin/gh-pages
$ git checkout -b gh-pages origin/gh-pages
Branch gh-pages set up to track remote branch refs/remotes/origin/gh-pages.
Switched to a new branch “gh-pages”
现在你只要提交gh—pages这个分支就可以变化你demo的内容
$ cd Repos/ampere
//可以在分支和主库中转换
$ git checkout master
$ git checkout gh-pages
//分支从主库更新(merge)
$ git merge gh-pages
更多帮助请看文档
git基本操作 branch和merge


