Jekyll deleted my entire site, source code, git repo, everything :( #902

kentonv opened this Issue Mar 30, 2013 · 2 comments


None yet

3 participants

kentonv commented Mar 30, 2013

So, I was writing a github page, was using Jekyll, and then I needed a custom Pygments lexer. This meant I needed to run Jekyll locally instead of letting github do it. So I move all my code into a subdirectory called "src", go into src, and type "jekyll .." to generate the site back into the root directory. Seemed reasonable.

Except, Jekyll recursively deletes everything in the target directory, including dotfiles, because it just assumes that it generated that data itself. So not only did it delete everything I wrote today, it took the .git directory with it. :(

Very luckily for me, like Wile E. Coyote running of a cliff, Jekyll managed to generate fresh .html files before it noticed that its source directory was gone and crashed out. So most of my text isn't lost, I just have to convert it back from HTML to markdown.

I realize that this was fundamentally user error on my part, but it seems worth doing something to make sure this doesn't happen to someone else, since it's not completely obvious that Jekyll intends to delete anything. Perhaps you could:

  • Refuse "." and ".." as target directories, since no user would ever want to do this.
  • Refuse to generate into a directory containing any dotfiles, especially ".git", because Jekyll certainly didn't generate these.
  • Or maybe, refuse to generate into any directory that exists, unless it is called _site, which can reasonably be assumed to contain the output from a previous run.
parkr commented Apr 1, 2013

#535 took care of this. :-)

@parkr parkr closed this Apr 1, 2013
kentonv commented Apr 1, 2013

Oops, sorry, I guess the Ubuntu package I am running is really old. Thanks!

@jekyllbot jekyllbot locked and limited conversation to collaborators Feb 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.