女装美少年革命cg存档:为已经存在的github octopress配置本地环境

来源:百度文库 编辑:偶看新闻 时间:2024/04/29 10:19:30

为已经存在的github Octopress配置本地环境

| Comments

在上一篇文章里面,我描述了如何创建一个全新的octopress并部署到github上。本文介绍如何为已经存在于github上的octopress配置本地环境。

  1. 在本地安装RVM(Ruby Version Manager)和Ruby 1.9.2;

  2. 从你的github得到你的octopress内容:

1234
git clone -b source git@github.com:username/username.github.com.git octopress # get the source code from your "source" branch of your octopress on github# learn from: http://stackoverflow.com/questions/1911109/git-clone-a-specific-branchcd octopressgit clone git@github.com:username/username.github.com.git _deploy # get your static pages content from your "master"branch of your cotopress on github
  1. 安装依赖gems:
123
gem install bundler # Install dependenciesbundle installrake install # Install the default Octopress theme
  1. 编写文章,预览部署:
12345
cd octopressrake new_post["Your Title of Your Article"]rake generate # generate your blog static pages content according to your input. rake preview # start a web server on "http://localhost:4000", you can preview your blog content.rake deploy # push your static pages content to your github pages repo ("master" branch)
  1. 提交你的文本修改到github:
1234
cd your_local_octopress_directorygit add .git commit -m 'your message'git push origin source

注意:如果要从github得到最新的source内容,请运行以下命令:

12345
cd your_local_octopress_directorycd _deploygit pull origin mastercd ..git pull origin source

原则很简单,只要记住“your_local_octopress_directory”对应的的remote source branch,而”_deploy”对应的是remote master branch即可。

Posted by Max Huang