Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rake gen_deploy rejected in Octopress

Tags:

octopress

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?

like image 337
shingo.nakanishi Avatar asked Jul 12 '13 07:07

shingo.nakanishi


1 Answers

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://stackoverflow.com/a/9629458/1369730

like image 110
Jesse Fisher Avatar answered Jan 03 '23 20:01

Jesse Fisher