Developer Accidentally Deletes Three-Month of Work With Visual Studio Code (bingj.com)
New submitter joshtops writes: A developer accidentally three-month of his work. In a post, he described his experience, "I had just downloaded VScode as an alternative and I was just playing with the source control option, seeing how it wanted to stage -- five thousand files -- I clicked discard... AND IT DELETED ALL MY FILES, ALL OF THEM, PERMANENTLY! How the f*uk is this s*it possible, who the hell is the d******* who made the option to permanently delete all the files on a project by accident even possible? Cannot even find them in the Recycle Bin!!!! I didn't even thought that was possible on Windows!!! F*ck this f*cking editor and f*ck whoever implemented this option. I wish you the worst.'
Fortunately he can just retrieve his files from his Git repository, right? Or... he just learned a painful lesson of why you always use a code repository.
This isn't about backups, it is about not having a central repository. It isn't enough to have revision control, you have to actually be checking it in to a repository and sharing code. Even if you're only sharing with yourself, you still want your revision control to work well. And if you're not synchronizing anything, then you're not even getting feedback about if the system is working.
It isn't enough to commit the code, you also have to push it somewhere. Even if that is just a repo on the same box.
You don't want to restore this situation from backups, you want the restore to be from the repo. Much simpler and more to the point. And the backup would be of the repo, not the working directory!
You don't even need a central repo. For small projects I just zip the .git directory and upload it to Dropbox or Google drive once or twice a week.
It could have been just as easily a drive failure that deleted all the data. Instead, it was discarding the changes (and keeping the original version - which in this case amounted to nothing) [my guess not having familiarity with the tool]...
I have lost a few hours of changes, but I it would be difficult to lose 3 months. You can use free services such as BitBucket for a single committer/project (private repository) as your offsite source control copy. You should also make a local backup and keep a regular offsite backup for important work that you cannot afford to lose. The fact that you get 3 months into a project then start thinking about source control is utter stupidity. It is a lesson this developer will hopefully learn (even if he has to learn it the hard way). On the bright side -- the second time I do something... it is always quicker...
A single copy on Dropbox that has no SLA with you... is not sufficient.
... one). (offsite cloud backup).
You can setup a free account for a private repository on Bitbucket (free for small teams of
You should also be doing regular local backups and rotating them at a friends house as well (3 copies minimum).
It does mean discard pending changes which in his case happened to be everything or mostly everything? Both Git and VSCode are functioning properly he just clicked buttons without understanding what they did first. if he had copy/pasted a git checkout or git rebase code snippet he got on some website that wiped his stuff out and he was surprised this would have a different reaction but its no different. 2 major issues I see: - Not having backups of an obviously huge project either in git already or in a different location? - Why was he testing out an editor and clicking buttons he had no idea what they did on such a important project?
So just for fun, I tried it.
Did he happen to ignore the popup with the big yellow exclamation mark that says:
"Are you sure you want to discard ALL changes? This is IRREVERSIBLE!"
At the very least the ALL CAPS WITH EXCLAMATION MARK! should have possibly made him think "Hmmm...this seems to be a pretty important question"
But apparently he decided: "Ah, screw it. It's only 3 months of my life".
Given that level of skill, I can't think much of importance was lost.
To be fair, I was using an old version of subversion, and issued a delete to a particular project branch I was working on. I deleted the project from that branch, and every other branch, along with every version. From everywhere. Not what I wanted. Not even what I asked. Turns out it was a bug triggered from upgrading the app on the specific platform I was on (I think it was Cygwin?)
I had another machine with an old trunk that I recovered from, but still, crap like that happens even with source control.
My Other Computer Is A Data General Nova III.
You're probably right.
Judging by the name, it would appear that this guy only graduated high school 2 years ago and recently graduated a free coding camp.
LK
"Hi. This is my friend, Jack Shit, and you don't know him." - Lord Kano
I'll agree that the language could be clearer, but it does show this popup when you try doing this right now. That should be a hint that something bad might happen, I'd say.
Totally this! I've been coding for some 20 years now or so. Even for small personal projects, they go into a managed repository. I lost about a week's worth of code in my youth, then I learned about Microsoft Visual SourceSafe, their local repository system. Then I transitioned that over to Source Offsite, a networked version of SourceSafe. This progression then moved through the ranks of CVS, SVN, and now to GIT. Having version control has so many benefits for even single devs, like diffing revision history. "How did I fuck myself up? Oh yeah, I can just check my commit history!" - This has saved my ass countless times.
It was ALL PENDING CHANGES.
He never did any commits!
Dewey, what part of this looks like authorities should be involved?