為已經存在的github octopress配置本地環境

為已經存在的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

推薦閱讀:

職業玩家打cf都用什麼配置?
遠景SUV和帝豪gs選哪款?
市場能否在資源配置中起決定性作用取決於政府如何發揮作用
如何做好家庭資產配置?港險來幫忙~~
汽車上哪些配置是無用多餘的?

TAG:環境 | 存在 | 配置 |