android.moparisthebest.org/source/docs/setup/index.markdown

65 lines
2.1 KiB
Markdown
Raw Normal View History

2011-07-19 22:28:48 -04:00
---
layout: page
title: Octopress Setup
date: July 18 2011
sidebar: false
footer: false
---
[Create a new repository](https://github.com/repositories/new) for your website then
open up a terminal and follow along. If you plan to host your site on [Github Pages](http://pages.github.com) for a user or organization, make sure the
repository is named `your_username.github.com` or `your_organization.github.com`.
``` sh
2011-07-19 22:28:48 -04:00
mkdir my_octopress_site
cd my_octopress_site
git init
git remote add octopress git://github.com/imathis/octopress.git
git pull octopress master
git remote add origin your/repository/url
2011-07-19 22:28:48 -04:00
git push origin master
```
2011-07-19 22:28:48 -04:00
Next, **if you're using [Github Pages](http://pages.github.com) to host a site for your user or organization**, create a source branch and push to origin source.
If you're using Github project pages, or hosting the site in a different way, skip this step.
``` sh
git checkout -b source
2011-07-19 22:28:48 -04:00
git push origin source
```
2011-07-19 22:28:48 -04:00
2011-08-03 11:48:33 -04:00
The `source` branch is created to have somewhere to store the source
for your site. GitHub user/organization pages expects the generated site to be pushed to the
2011-08-03 11:48:33 -04:00
`master` branch of your GitHub repository so that branch needs to stay
clean. In [Deploying Octopress](/docs/deploying/) we'll setup the `master` branch for deployment.
2011-08-03 11:48:33 -04:00
2011-07-19 22:28:48 -04:00
Next, setup an [RVM](http://beginrescueend.com/) and install dependencies.
``` sh
2011-07-19 22:28:48 -04:00
rvm rvmrc trust
rvm reload
gem install bundler
gem install rake
2011-07-19 22:28:48 -04:00
bundle install
```
2011-07-19 22:28:48 -04:00
Install the default Octopress theme,
``` sh
2011-07-19 22:28:48 -04:00
rake install
```
### What to Commit?
2011-07-19 22:28:48 -04:00
With `rake install` you've setup the default Octopress theme in the `source` and `sass` directories. Add them to your git repository, commit and push. *Remember if you're hosting with Github user/organization pages, you'll want to commit these to the `source` branch.*
2011-07-19 22:28:48 -04:00
``` sh
git add .
git commit -m 'Installed Octopress theme'
git push
```
2011-07-23 01:36:20 -04:00
Whenever you write a new post, or make changes to your blog, be sure to commit and push those changes.
2011-07-23 01:36:20 -04:00
See also [Configuring Octopress](/docs/configuring), [Blogging with Octopress](/docs/blogging/) and [Deploying Octopress](/docs/deploying/)