在上一篇文章里面,我描述了如何创建一个全新的octopress并部署到github上。本文介绍如何为已经存在于github上的octopress配置本地环境。
在本地安装RVM(Ruby Version Manager)和Ruby 1.9.2;
从你的github得到你的octopress内容:
1 | git clone -b source https://github.com/username/username.github.com.git octopress # get the source code from your "source" branch of your octopress on github |
- 安装依赖gems:
1 | gem install bundler # install bundler gem if you didn't |
Added@20130530:
before running the above commands, please make sure you have the following lines in you “~/.bashrc” file, otherwise you will get error “Gem bundler is not installed, run gem install bundler
first” when executing “bundle install”:
1 | # Load RVM function |
- 编写文章,预览部署:
1 | cd octopress |
- 提交你的文本修改到github:
1 | cd your_local_octopress_directory |
注意:如果要从github得到最新的source内容,请运行以下命令:
1 | cd your_local_octopress_directory |
原则很简单,只要记住“your_local_octopress_directory”对应的是remote source branch,而”_deploy”对应的是remote master branch即可。