middleman-gh-pages: Error when publishing

Working from the master branch I commit my changes and push to master.

I then run the rake build command which finishes successfully.

I then run rake publish and get the following error:

...
git push origin gh-pages
error: src refspec gh-pages does not match any.
error: failed to push some refs to 'git@github.com:frechg/portfolio_2014.git'
rake aborted!
Command failed with status (1): [git push origin gh-pages...]
/Users/galenfrechette/.rvm/gems/ruby-2.1.0/gems/middleman-gh-pages-0.0.3/lib/middleman-gh-pages/tasks/gh-pages.rake:81:in `block (2 levels) in <top (required)>'
/Users/galenfrechette/.rvm/gems/ruby-2.1.0/gems/middleman-gh-pages-0.0.3/lib/middleman-gh-pages/tasks/gh-pages.rake:74:in `block in <top (required)>'
Tasks: TOP => publish
(See full trace by running task with --trace)

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 19 (6 by maintainers)

Most upvoted comments

Workaround: delete the build subdirectory, and then rake publish.

The problem here is that if you run rake build (to test your site), then the “build” subdirectory won’t be correctly set up as a clone of the gh-pages branch.