Setup Octopress, change to the directory where you want your blog to reside
12
> git clone git://github.com/imathis/octopress.git octopress
> cd octopress
Install dependencies
12
> gem install bundler
> bundle install
Install default Octopress theme.
1
> rake install
Configure your blog by updating _config.yml, name of your blog, your name and things like that.
Create a new repo of the form YOUR-GITHUB-USER-NAME.github.io in github
123
> rake setup_github_pages
# this command will ask your for your github pages url, so type
https://github.com/YOUR-GITHUB-USER-NAME/YOUR-GITHUB-USER-NAME.github.io
and run the following commands to deploy your local blog to github
1234
> rake generate
> rake deploy
# what this does is basically makes the master branch of your github repo contain all the generated
# files namely _deploy folder in your directory.
If everything worked fine, you will be able to see your blog with the defalt octopress template on YOUR-GITHUB-USER-NAME.github.io
Every time you update your blog you need ro do rake generate and rake deploy these commands will push your changes to your master branch on the remote
You can make a new post using rake new_post command
1
> rake new_post["My first Blog Post"]
The above command creates a new markdown file in source/_posts folder, write your blog in markdown
Commit the changes you made locally in your local branch source
1234
> git status
# this will show that there are changes in the folder source/_posts
> git add .
> git commit -m "my first blog post"
If you want can create a new branch called source in your remote repository for the source files
1
> git push origin source
This is what you do everytime you create a new post
123456
> rake new_post["new blog post"]
> rake generate
> rake deploy # to deploy static files in the remote master branch.
> git add . # or you can specify the markdown file
> git commit -m "new blog post"
> git push origin source # to push the source files to the source branch
I only did this because my newly minted blog doesn’t contain many entries :D