As the title says. I put the wrong value inside a clean up code and I wiped everything. I did not push any important work. I just want to cry but at least I can offer it to you.
Do not hesitate to push even if your project is in a broken state.
git commit, git push, git out
No backup, no mercy.
Sympathy upvote
I did a “rm -rf *” in the wrong directory today.
I got the absolutely beautiful “argument list too long” in return.
I had a backup. But holy shit I’m glad the directory had thousands of files in it and nothing happened. First time I got that bash error and was happy.
I usually have rm aliased to “trash” or whatever that cli based recycle bin is. But just installed a new OS and ran this on a NAS folder today by mistake.
My dad once rm -rf’ed his company’s payroll server by accident. He was a database admin at the time. He was asked to make a quick update to something. Instead of running it as a transaction (which would have been reversible) he went “eh it’s a simple update.” He hit Enter after typing out the change for the one entry, and saw “26478 entries updated”. At that point, his stomach fell out of his asshole.
The company was too cheap to commit to regular 3-2-1 backups, so the most recent backup he had was a manual quarterly backup from three months ago. Luckily, Payroll still had paper timesheets for the past month, so they were able to stick an intern on data entry and get people paid. So they just had a void for those two months in between the backup and the paper timesheets.
It wasn’t a huge issue, except for the fact that one of their employees was on parole. The parole officer asked the company to prove that the employee was working when he said he was. The officer wanted records for, you guessed it, the past three months. At that point, the company had to publicly admit to the fuckup. My dad was asked to resign… But at least the company started funding regular 3-2-1 backups (right before his two week notice was up.)
You guys don’t use a COW (copy on write) filesystem?
Do you at least have some local commits to get back to? Or did your job remove the .git folder as well? 👀
also removed .git
You have backups? Right?
what garbage cleanup tool gets rid of dotfiles, especially .git? if you let us know we can learn to avoid it
shutil.remove_tree(BASE_DIR)instead ofshutil.remove_tree(TEMP_DIR)inside of tear down codeoh, I see. well, lessons learned hopefully! :)
On top of that, the content of
.git/objects/is write protected, so even if you gorm -r, you’ll get an additional warning.
If you’re using vscode you might be able to look through the individual file histories to recover some work.
deleted by creator
you do have backups of course, right?
cries
You’ve done it a few times? At the same job? Are you self-employed?
deleted by creator
I keep my git clone in Dropbox so I can revert accidental delete and always have the most recent code on all devices without having to remember to commit and push. If it requires manual execution I wouldn’t really consider it a proper backup solution.
I have been burnt by Dropbox in the past so now use Syncthing between my desktop, laptop, and a private remote server with file versioning turned on. Trivial to global ignore node_modules, and not giving data to a third party.
It’s saved me on several occasions.
F
Sounds like you need Jujutsu 🥰
I wanted to publish a tiny utility I created to GitHub (you know, it might be useful to someone else…). Before that, I wanted to some cleanup, rebasing/squashing a bit, etc. In the middle of that:
$ git checkout featurebranch The following untracked working tree files would be overwritten by checkout: .gitignore .idea/… etc...Oh, sure, no problem…
$ rm -rf * .* $ git checkout featurebranch fatal: not a git repository (or any of the parent directories): .gitD’oh! (Never mind, it probably wouldn’t have been useful to anyone else, anyway.)
Time to implement a couple forms of backups.








