Octopress/Octopress with Github Project Pages/Attic
From charlesreid1
Every project can also create a collection of hosted GitHub pages. To do this, you can create a branch called gh-pages that will be completely separate from your other branches and will contain all of the content served by the web server when you go to the page http://username.github.io/project
The Procedure
Create Local Copy of Project
First thing you'll need to do is clone your project from Github:
git clone https://github.com/charlesreid1/project
Checkout Web Content Branch
Now, web content is served from a special branch in the Github repository, the gh-pages branch. Everything in that branch is hosted by Github pages web servers.
You have a few different options for creating this branch. If you wanted to create and host a couple of pages of your own content, you could manually create a gh-pages branch, as detailed in this guide. Alternatively, you can let rake take care of everything, as detailed in this guide.
I'll cover both.
Manually Create Branch
You want to create the gh-pages branch. Assuming you've already cloned the project, check out the gh-pages branch for the first time as an orphan branch (i.e., totally empty):
git checkout --orphan gh-pages
Now make sure there's nothing in the branch already. You can clean it out:
git rm -rf .
and commit changes when ready:
git add . git commit -am "init commit" git push origin gh-pages
Now your site at http://username.github.io/projectname should be empty and ready for Octopress.
Create Branch with Rake
If you pass a project repository instead of a username.github.io repository, the rake file will know to create a gh-pages branch for the project. To do this, clone your project repository and run the following command in it:
bundle exec rake setup_github_pages
DON'T FORGET! If the above command doesn't work, it's probably because you didn't install the Octopress bundle! See [[1]] for instructions
Then you can create/edit/delete posts and do other things. When you're all done and ready to make the static content, you run:
bundle exec rake generate
which generates the content, and
bundle exec rake deploy
which deploys it to the right branch of the right repository.
Other stupid stuff you have to do
I don't know why you have to do this, but just do it (see http://octopress.org/docs/deploying/github/):
git remote add origin (your repo url) # set your new origin as the default branch (whatever that means) git config branch.master.remote origin