准备工作
- 在https://github.com/中注册一个帐号。
- 下载一个git,参考一篇git入门指南。
参考资料: 如何高效利用GitHub
如何使用GitHub写博客
可以在Github上快速搭建一个基于jekyll的博客系统
- Jekyll:参考告别wordpress,拥抱jekyll
- 利用Jekyll搭建个人博客
- Octopress:参考Ruby开源项目介绍(1):octopress——像黑客一样写博客
由于我的系统平台是WindowXP,所以参考了 5步搭建博客
第一步:
注册GitHub,注册完后,配置Git。这里没有谈到添加SSH密钥,可参考Generating SSH Keys
注意:默认的22号端口有可能被占用或阻止,可建立一个config文件进行设置
Host github.com
User username@email.com
Port 443
Hostname ssh.github.com
请把username@email.com换成你的GitHub注册邮箱。
single asterisks
single underscores
double asterisks
double underscores

第二步:
搭建Ruby环境
注意:我在我的机子上使用Git Bash无法启动ruby,因此我只好单独启动Ruby来完成第二、三、四步。
可通过我的电脑/属性/高级/环境变量添加Ruby的路径,解决此问题
第三步:
安装Octopress框架
第四步:
写一篇简单的blog进行测试。jekyll采用markdown格式的轻量级标记语言。 关于markdown语言可参考Markdown 语法说明。 注意:这步可能出现GBK编码错误。
第五步
最后一步,要把本地文件部署到GitHub服务器上去。
Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:username/username.github.com.git
git push -u origin master
Push an existing repository from the command line
git remote add origin git@github.com:username/username.github.com.git
git push -u origin master
*以上是GIT的提示,我是使用如下命令进行的发布
rake deploy
最后提交代码
git add .
git commit -a -m 'comment'
git push -u origin source