When I setup Octopress Repository, error of

1
rake deploy

I setup the Octopress, and I create,

1
rake new_post\["Hello World"\]

then push github on

1
source

branch, and when I

1
rake deploy

Terminal show this code :

1
2
3
4
5
6
7
To https://github.com/username/username.github.io.git
! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/username/username.github.io.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
 Github Pages deploy complete

What I can fix it ?

Firstly

1
2
git clone https://github.com/username/username.github.io.git
git checkout source

I cloning to username.github.io into master, and checkout source

Secondly we need to setup ‘deploy’ directories

1
2
3
4
mkdir _deploy
cd _deploy
git init
git remote add -t master -f origin https://github.com/username/username.github.io.git

Now, we can use

1
rake deploy

or

1
rake gen_deploy

Comments