Learnings

iOS, Rails, AngularJS, Node.js, Devops and everything in between.

How Do I Use This Bloody Thing?

Note to self…

Clone the repo - this will get you Master:

1
2
> git clone https://github.com/jeremychu/jeremychu.github.io.git
> cd jeremychu.github.io

Now switch to the Source branch:

1
> git checkout -b source origin/source

Setup for deployment to Github:

1
2
3
4
5
> rake setup_github_pages
  Enter the read/write url for your repository
  (For example, 'git@github.com:your_username/your_username.github.io.git)
             or 'https://github.com/your_username/your_username.github.io')
  Repository url: git@github.com:jeremychu/jeremychu.github.io.git

You can now run rake generate and rake deploy , however it doesn’t work. I have no idea why.
Future Jeremy, go and find out why!

1
2
3
4
5
6
7
8
9
10
11
12
> rake generate
...
> rake deploy

## Pushing generated _deploy website
To git@github.com:jeremychu/jeremychu.github.io.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:jeremychu/jeremychu.github.io.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

To fix it I do the following:

1
2
3
4
> cd _deploy
> git pull origin master
> cd ..
> rake deploy

Success!

Create a post:

1
> rake new_post['a new lot of learnings']

Don’t forget to commit the source:

1
2
3
> git add .
> git commit -m "Updates to blog source"
> git push

Comments