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.
i
sudo shutdown now
the main production (remote) server a few times before, and ive been doing sshing into servers for a long time.there there 🫂 its ok. we all do this shit. you do have backups of course, right?
You’ve done it a few times? At the same job? Are you self-employed?
throughout many years.
Ya, push push push baby, do it on your own branch so that you can find your way back if needed.
Especially when refactoring.
Oh man, I hate losing code. Last time it happened I spent more time trying to recover it than it would’ve taken to rewrite it.
You can’t just… replace your baby, man!
On the contrary! I found out that a rewrite from scratch leads to much better code and abstractions, as you understand the problem space better. (On the other hand, beware of http://catb.org/jargon/html/S/second-system-effect.html)
I have a separate usb harddrive for just this occasion. My lazy ass just likes to play "We backed it up last time, do we need to do it every time?
On the bright side, you’ve now got squeaky clean disk space to fill with new projects!
IN CASE OF FIRE 1. git commit 2. git push 3. exit building
Except when everyone pushes to main at the same time and now you have conflicts.
Who pushes to main? That branch should be protected! Who reviews the merge request?
Lol, standards 🙄
They wouldn’t push to main at the same time tho, they would push to the branches they’re working on. Unless their organization is very badly run, and then it’s probably already happened before just because it was Tuesday.
git commit -m 'asdf'
I have this printed on a sign at work.
It was on a sign where I once worked, but that was almost 10 years ago.
Sympathy upvote
Some wisdom my dad shared with me decades ago: when you’ve lost everything and must rebuild, the rebuild is ALWAYS better. As a programmer for a very long time who has done what you did, I have found this to be true. So there is your silver lining.
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.
Sorry this happened.
Use it as an opportunity to learn how to better store and edit your code (e.g. a VCS and a smart-ish editor). For me, a simple Ctrl-Z would be enough to get my code back.