Skip to content


Subversion checkout URL

You can clone with
Download ZIP


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

kentonv opened this Issue · 2 comments

2 participants


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.

#535 took care of this. :-)

@parkr parkr closed this

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.