Question

Can't setup Octopress blog on Github. I'm following this guide on octopress but after creating a repository on github and preparing everything I can't deploy on github.

I have two branches, master and gh-pages and after trying I have just deleted everything and I want to start from the beginning.

Should I put octopress folder inside my repository folder locally? Or do they have to be in two different folders? That guide is a bit confusing, and I am very new to git.
Can anyone who have already done it explain how to deploy on github with github-pages?

Was it helpful?

Solution

I agree with you that the tutorial is a bit complicated, but follow it strictly and you will be able to setup correctly.

So, in order to do that, create like a folder into your computer with the octopress content (don't forget about installing bundler and 'rake install') and create a repo in github with YOU_USERNAME.github.com .

Finally, deploy to github, running 'rake setup_github_pages', do generate and deploy. Your page is ready. Just go to you source folder and run the other 3 git commands, to have it backed up.

If you have doubts, see my repo for reference. I have even set my domain (lucasarruda.com) to it.

Obs.: wait for some minutes when you just created the repository. Then commiting should be almost instant.

OTHER TIPS

I agree it is a bit complicated, but once you have it setup, it is so easy to use. You don't need to clone your github repo, everything should be done in your Octopress folder (but you need to establish an SSH key connection with your repo), Here is how I set it up:

From your github account:

  1. create a new repo and name it username.github.io, in my case iamaziz.github.io.

Clone Octopress blog project:

  1. git clone https://github.com/imathis/octopress.git

From Octopress blog root folder:

  1. run rake setup_github_pages, and ansewer with your repo credentials (the one you just created). (Note: make sure you have SSH key setup between your github account and your computer.)
  2. run rake generate (This will create your posts and pages)
  3. run rake deploy (This will push the contents of _deploy to your master branch).

It should ask for your ssh key password (if it is not already saved in the keychain) then you will see something like identity added: ... and deployment will start.

Note:

if you get a message says permission denied when you run rake deploy, this means SSH key (public key) does not exists or not establish correctly. See: error permission-denied.

If everything is ok, your blog is ready at: http://username.github.io/

One more thing:

However, you also need to push the source of your Octopress project to source branch of your repo as follows, change directory to source folder and run:

  1. git add .
  2. git commit -m "your msg"
  3. git push origin source

Done!

From now on you should be for blogging, as follow:

  1. Create and edit posts: rake new_post["title"]
  2. Generate them: rake generate
  3. deploy them to your github pages: rake deploy
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top