Question

I am setting up Octopress and I have a static site (with a bunch of HTML files and some CSS, etc.) in my _deploy directory.

When I do a rake deploy this is what happens:

$ rake deploy
## Deploying branch to Github Pages 
## Pulling any updates from Github Pages 
cd _deploy
You asked me to pull without telling me which branch you
want to merge with, and 'branch.gh-pages.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.

If you often merge with the same branch, you may want to
use something like the following in your configuration file:

    [branch "gh-pages"]
    remote = <nickname>
    merge = <remote-ref>

    [remote "<nickname>"]
    url = <url>
    fetch = <refspec>

See git-config(1) for details.
cd -
rm -rf _deploy/adintennis.html
rm -rf _deploy/assets
rm -rf _deploy/atom.xml
rm -rf _deploy/blog
rm -rf _deploy/CNAME
rm -rf _deploy/compversions.html
rm -rf _deploy/css
rm -rf _deploy/favicon.png
rm -rf _deploy/font
rm -rf _deploy/googlekjhaskjdhgkjhgas.html
rm -rf _deploy/images
rm -rf _deploy/img
rm -rf _deploy/index.html
rm -rf _deploy/javascripts
rm -rf _deploy/js
rm -rf _deploy/leadsriver.html
rm -rf _deploy/robots.txt
rm -rf _deploy/sitemap.xml
rm -rf _deploy/stylesheets

## Copying public/blog to _deploy
cp -r public/blog/. _deploy
cd _deploy

## Commiting: Site updated at 2013-09-13 21:09:43 UTC
[gh-pages some-hash] Site updated at 2013-09-13 21:09:43 UTC
 13 files changed, 56 insertions(+), 56 deletions(-)

## Pushing generated _deploy website
Counting objects: 51, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (22/22), done.
Writing objects: 100% (26/26), 1.96 KiB, done.
Total 26 (delta 14), reused 0 (delta 0)
To git@github.com:my-username/my-repo.git
   some...hash  gh-pages -> gh-pages

## Github Pages deploy complete
cd -

Basically it is deleting every file that was not 'generated' by 'rake generate'.

Was it helpful?

Solution

The reason it's doing that is because the default Rakefile is configured to rm -rf files inside _deploy every time you run rake deploy

(Dir["#{deploy_dir}/*"]).each { |f| rm_rf(f) } # line 254

You probably want to comment out that line, and try to deploy again.

Also: .gitignore that ships with Octopress includes _deploy by default, so you'll want to remove it from there as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top