Ashish Jaiswal Blog

A blog dedicated to community

Setup Octopress With GitHub

This post will guide you how to setup the Octopress blog and host it with Github. Why did I choosed Octopress for my blogging, I guess it was simple and better integration with github, and I didn’t wanted to spend any extra bucks for this. I’m currently setting this up in Elementary OS backed by ubuntu 12.04.

Check whether your ruby version is 1.9.3 or more then this

1
apt-get install ruby1.9.1-full

Clone the Octopress to your working directory.

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

Run this command and the Octopress is good to go.

1
2
3
4
cd octopress/
sudo gem install bundler
bundle install
rake install

Just to check whether every thing is working or not.

1
rake preview

Check in your local browser, whether you can view page or not.

1
http://localhost:4000

If you can see the Octopress sample page. that means you are good to go. Next we can setup it with Github. It will ask your repository link, in my case it is git@github.com:ashish1099/ashish.github.io.git

1
2
3
rake setup_github_pages
rake generate
rake deploy

Next we need to commit the source branch into GitHub.

1
2
3
git add .
git commit -m 'your message'
git push origin source

If anything failed, check this commands.

1
2
3
4
5
git remote -v
octopress      git@github.com:imathis/octopress.git (fetch)
octopress      git@github.com:imathis/octopress.git (push)
origin    git@github.com:ashish1099/ashish.github.io.git (fetch)
origin    git@github.com:ashish1099/ashish.github.io.git (push)

If the above command is not returning your git repository, then probably you will have to add this.

1
git remote add origin git@github.com:ashish1099/ashish.github.io.git

Check what is the branch, it should be source branch.

1
2
git branch
* master

If it is not source branch, then change it to source branch by this command.

1
2
3
git branch -m master source
git branch
* source

Comments