How to contribute to existing Octopress blog from other computer (Windows)
I’ve created my blog from my home Mac, but sometimes I wanted to add some brief posts from the work Windows computer, when thing I wanted to add is still fresh in my memory. I was wondering how can I do it? I found helpful article from dBlog.org. Last part was particularly helpful, but those instructions are for Linux/Unix/Mac users and didn’t worked for me right away, but I have to do some extra steps.
Install Ruby for Windows
First need to install ruby. I’ve used RubyInstaller for Windows to install latest version. This is pretty streight forward and shouldn’t cause any problems.
Install GitHub for Windows
It is possible to install just git, but I’ve encountered some problems with connection to GitHub: Permission denied (publickey)
. Of cause it possible to generate this key using openssh and add it to your GitHub account’s key list. But I dicided to use native GitHub for Windows, which handled all this issues for me automatically.
- Download and install GitHub for Windows
- Start GitHub and login using your GitHub account
- Set your username and email: select tools > options…, under ‘git configuration’ check that your username and email are correct
- Define where your projects will be cloned, select tools > options… and change ‘default storage directory’ to one you prefer. I’ve used default, so for me it is optional step
- Define what shell you’ll prefer to use: select tools > options… and select one you prefer from ‘default shell’ list. I’ve tried PowerShell first, but there was some problems with it, so I switched to Git Bash.
Clone your blog from GitHub
I’ve started cloning from GitHub Windows app and then switched to shell.
- From left panel in GitHub app select your account under github section
- Select your blog repository and click clone
- When clone is complete select open this repo
- Start shell by selecting tools > open a shell here
- From this step on everything will be done in shell. First all required ruby gems need to be installed:
bundle install
- From here I’ve followed instructions from dBlog.org article’s last part except cloning, since it was already done:
username.github.com$ git checkout source username.github.com$ mkdir _deploy username.github.com$ cd _deploy username.github.com/_deploy$ git init username.github.com/_deploy$ git remote add origin git@github.com:username/username.github.com.git username.github.com/_deploy$ git pull origin master username.github.com/_deploy$ cd .. username.github.com$
Creating new post
Now I was ready to post my new post and I did it as following:
rake new_post["Post Title"]
- edit post, I’m using MarkdownPad for Windows
rake generate
rake deploy
git add .
git commit -m 'some comments'
git push origin source