Reputation: 2817
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)
I resolve this problem, in GitHub delete my-name.github.io.git, and make same name repository and
$ rake gen_deploy
What is the best solution?
Upvotes: 10
Views: 2938
Reputation:
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.
Upvotes: 21
Reputation: 785
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
Upvotes: 37