rake gen_deploy rejected in Octopress
Asked Answered
A

2

10

I installed Octopress in GitHub Pages.

And I clone the repository.

$ git clone [email protected]:my-name/my-name.github.io.git

$ git checkout source

And

$ rake setup_github_pages

I input my repository name.

And

$ rake gen_deploy

I got error

! [rejected] master -> master (non-fast-forward)

my solution

I resolve this problem, in GitHub delete my-name.github.io.git, and make same name repository and

$ rake gen_deploy

But I don't want to delete repository

What is the best solution?

Andalusite answered 12/7, 2013 at 7:14 Comment(1)
There’s no need to repeat “Octopress” in the title – the context of the question is already given by the tags. In addition, Stack Overflow actually auto-adds some tags to the page title. If your title already mentions the tags, they may be displayed weirdly in the Google results (e.g. in this case as “[octopress] rake gen_deploy rejected in Octopress”).Xylon
S
21

I have the same problem when hosting my Octopress blog on github pages. I Googled a lot and finally solved this problem.

Just change the directory.

cd octopress/_deploy
git pull origin master
cd ..
rake deploy

Then it's fixed.

Scarab answered 24/11, 2013 at 19:5 Comment(1)
Perfect - worked for me. Although I did run into merge conflicts with each file, but took the head for each file.Selfassurance
A
37

Without deleting the repository

Please keep in mind this is not considered best practice, but it may work for you.

The solution is to force a push on the master branch.

Edit the Rakefile and look for this line:

system "git push origin #{deploy_branch}"

Alter the line by adding a plus (+) before the #{deploy_branch} tag:

system "git push origin +#{deploy_branch}"

Run the command

rake deploy

It should succeed.

Undo the edit you made to the Rakefile!

Idea for this solution came from reading this: https://mcmap.net/q/13478/-how-to-merge-remote-changes-at-github

Ariannaarianne answered 3/8, 2013 at 21:58 Comment(2)
You sir are amazing. I wish I could +1k this. I searched for 2 days on how to resolve this, and nothing else worked but this. Thank you so much!Stipulation
I wasted almost 2 hrs on this but your comment saved many hours. Thanks a lot :)Outdoors
S
21

I have the same problem when hosting my Octopress blog on github pages. I Googled a lot and finally solved this problem.

Just change the directory.

cd octopress/_deploy
git pull origin master
cd ..
rake deploy

Then it's fixed.

Scarab answered 24/11, 2013 at 19:5 Comment(1)
Perfect - worked for me. Although I did run into merge conflicts with each file, but took the head for each file.Selfassurance

© 2022 - 2024 — McMap. All rights reserved.