3 ms·
I almost had an heart attack after doing `git push --mirror`. It deleted 95% of branches locally and on origin without leaving much of a trace, or any way to u
by manveru 14y ago
I almost had an heart attack after doing `git push --mirror`.
It deleted 95% of branches locally and on origin without leaving much of a trace, or any way to undo (well, none that i know of).
Good thing I had a clone on a machine at home, so I drove home, made local branches for each remote branch and then pushed each.
So yeah, there might be a way to get that stuff back, and I don't even have experience with non-DVCS, but the lesson I learned a long time ago with darcs is that you better have up-to-date off-site backups of your repositories, never trust yourself or your DVCS too much.
The upside is that keeping backups is easy, and good practice anyway, so if you're not doing it yet, don't wait.
- qu4z-2 14y agoMy worst experience on that front was with jekyll. Running jekyll without parameters compiles the source in the current directory, putting the output either in $PWD/_site, or wherever the config file for the project says. I was in the parent directory, and thought I'd try to run jekyll projectname rather than having to cd in and out of the project. The end result? It tries to compile the project in the current directory, writing output to the directory specified. As an added bonus, it completely nukes the target directory, including the .git subdir. And to add insult to injury, $PWD didn't even contain a valid project, so it error'd out immediately after wiping out the entire source. The morale of the story: Always keep offsite backups.