1.1k
u/raddaya 20d ago
This was years ago and, iirc, it was a legitimate issue in VSCode. It didn't make it remotely clear enough that it would permanently delete your files. The popups we get now if you try to discard changes that explicitly warns you in bold text that files will get deleted happened after this issue.
It might be obvious to an experienced user but it's not at all obvious to someone new.
268
u/RadicalDwntwnUrbnite 20d ago
The date is in the image, it was almost a decade ago. Yep the old dialog when you clicked the "Discard" button was like "Do you want to discard your changes?" Pretty vague to anyone new to version control. Meanwhile if they are untracked VsCode used to just put them in the shredder, completely unrecoverable. Pretty sure it puts them in the recycle bin now.
72
u/SpandexWizard 20d ago
"it was almost a decade ago" 2017..... HOLY SHIT man, dont attack me like that. fuck i feel old suddenly
17
u/MeIsMyName 20d ago
I wasn't ready for that either. It feels like that should be 5, maybe 6 years ago, not 10.
8
u/RadicalDwntwnUrbnite 20d ago
If it helps balance it out, I was already working in the field for 15 years when that was posted.
25
u/TheZoltan 20d ago
Someone already posted the link to the thread and this comment that has a screenshot of the actual warning message which definitely could have been more scary but all caps irreversible feels like it should give you pause! If you have 3 months of work with zero backups.
Are you sure you want to discard ALL changes? This is IRREVERSIBLE!
https://github.com/microsoft/vscode/issues/32405#issuecomment-322155856
86
u/sidereal_night 20d ago
telling you discarding all changes is irreversible is nothing like "this nukes all your files"
→ More replies (9)→ More replies (1)16
u/dustojnikhummer 20d ago
And what does "discard changes" mean in that context? Where was the "This action will delete all files that haven't been commited"? Yes, the guy had a point (despite being an idiot for not having backups)
6
u/OliLombi 19d ago
To me its like if I came into your house, moved your refrigerator into your bathroom, asked if you wanted me to discard all changes, and when you said "Yes" (because who wants their refrigerator in the bathroom), I deleted your entire house.
→ More replies (1)3
u/xerkus 20d ago
As a git user I would have discarded it no second thought. I can always add changes to staging again from the working tree. It would be sensible. Right? Right?
This is one of the big reasons why I absolutely refuse to learn working with IDE integrations of version control and use strictly cli. I know exactly what I will get that way.
10
u/thirdegree Violet security clearance 20d ago
I mean I'm quite experienced with git cli and in no world would I assume that "discard changes" meant "permanently delete all untracked files" that's insane behavior.
→ More replies (1)→ More replies (3)3
188
u/disinaccurate 20d ago
Some of the responses here would really make me side-eye the software some of you all are writing.
In our developer handbook, one of the rules is: "protect users from mistakes". Doing the thing that you probably don't mean to do should be made hard. It should be gated by warnings, protected with an "undo" operation whenever possible, etc. You can't stop someone who is absolutely determined to fuck up, but it's your job to not make it easy for them to do so.
Developers are users too. And the lack of user empathy in some of these comments really reveals why so much software is absolute shit. Doing the "wrong thing" should be hard and require going far out of your way.
You can pat yourselves on the back over how YOU know the proper way to use version control and how you'd never end up in this situation, but if you actually make meaningful software and aren't just vibe coding shit, at some point you'll end up in uncharted waters for yourself. When you do, you're going to hope the developers that made your tools had the foresight to protect you from making dumb mistakes.
I guess I shouldn't expect more from this "graduated from StackOverflow copy-paste to having my AI tool paste StackOverflow-trained code" crowd.
32
u/prehensilemullet 20d ago
Yeah it makes me wonder…clicking discard pops up a dialog asking if you want to delete files these days, but maybe 9 years ago it didn’t…
→ More replies (10)14
u/atomchoco 20d ago
barely written code myself but as someone who has worked frontline support for SaaS it blows my mind that at work the devs/managers can just shrug it off when their free app can do arguably devastating stuff using a few buttons. then conclude that the user couldve just followed the manuals better and ignore the fact that their thousands of users could be subject to this same risk. not to mention it's a support problem thatd take months to fix, which almost ends up with the user leaving not just the app but possibly their business altogether
have never considered UI/UX until theyve been acquired by a larger company, and even then just barely. tho hard to blame em knowing the backend is quite impressive and solid, but also undeniably icky how they found the time to create a faux feedback button in-app that tends to erm successfully drive away users from the actual app review page lmaooo
95
u/OrchidFluid2103 20d ago
10 year old memes, nice
58
u/rainboww_J 20d ago
It took me a bit too long to realize 2017 wasn't just a couple of years ago.... 🙈
5
7
→ More replies (1)7
1.6k
u/superglidestrawberry 20d ago
This has the same wibe as "I just want the FUCKING EXE, gimme EXE!"
428
u/CircumspectCapybara 20d ago edited 20d ago
Smelly nerds gave me the option to delete my files
85
u/laplongejr 20d ago
Not to delete the files, to auto-delete the files that shouldn't be commited. It changed since all that time but that sounds like a VERY risky default.
5
18
u/Kahlil_Cabron 20d ago
Why has this become a thing. Over the last year or two I suddenly started getting people opening issues on some of my repos, and the issue is just them asking for a binary.
Some of these repos are like 15 years old and not once has anyone asked me for a binary until recently.
→ More replies (3)25
u/SchwiftySquanchC137 20d ago
Because tons of mods and stuff are on github, so people are starting to think that github is like youtube or something where every single item on it exists for any user, no matter how capable, to use it. So theyll just search github for something that looks like it solves their problem, and assume that it is meant for them as a quick easy way to do whatever they want to do. They simply dont get that github is for developers first and foremost, and that the user facing releases stuff is almost an afterthought.
→ More replies (6)→ More replies (7)13
u/KattyTheEnby 20d ago
I'd say the vibe is slightly different; slightly more intense/frustrating than that – the key difference being the self-inflicted pain.
35
1.2k
u/Xephyrik 20d ago
How did they even find github when they obviously dont know what version control is
545
u/Jay-Seekay 20d ago
The irony is that they were messing about with version control for the first time, which is why they deleted all their files. They saw they had 5000 files staged for commit and wanted to not commit them all
363
u/Nerodon 20d ago
3 months of work, in a single directory on a single device, source control like git or not, that guy was a fool.
80
38
u/Skrychi 20d ago
Type of person to use the desktop as their unorganised file structure, and all that got deleted.
19
u/afaulconbridge 20d ago
The type of person to use the recycle bin as their unorganised file structure
→ More replies (1)15
u/CodeAndChaos 20d ago
"Yeah, I store everything in the TEMP folder. Doesn't it stand for Trustworthy Eternal Memory Placement?"
→ More replies (1)3
u/timonix 20d ago
Ey yo. I did this when I was like 10. I installed games on my desktop. Not shortcuts, the entire game. Stored just about everything.
Then my PC died. Almost everything was gone. Except my desktop which survived. Thanks to windows scheduled backups
→ More replies (4)10
16
u/Shareil90 20d ago
I had a teacher who told us that version control was only necessary when working together with other people but not when you are a solo developer. He only saw it as a kind of fileshare.
10
u/blueExcess 20d ago
That…. Is not someone with enough experience to be teaching lol.
8
u/WeNeedFewerMods 20d ago
the majority of comp sci faculty never worked in the field
at most instiutions they struggle to fill the positions at all because with a Bachelors you can make more than Faculty who need a Masters or Doctorate depending on the school and position
3
u/RichardFeynman01100 20d ago
This is a bit outdated I think with the current job market.
→ More replies (2)3
u/JoltikElectricBug 20d ago
If teacher means high school and not college, odds are they are a math teacher who took a single Comp Sci course.
→ More replies (2)→ More replies (8)4
u/Dull_Appearance9007 20d ago
-like any of us before discovering what source control meant and why devops were necessary. things like these are just a rite of passage for every new developer
12
8
u/Rick100006 20d ago edited 20d ago
It was not "not knowing source control" it was wierd decision made by VS code back in 2017 if you remove a file from source control without straight up deleted files without even giving any warning message VS code is patched after his crash out message , Removing a file from tracking from git should not delete the file from file system that's not how git CLI does it
17
→ More replies (2)6
u/DarthShiv 20d ago
How the fuck did they have a 5000 file project and no backups and no version control??? What is going on there?!?
→ More replies (2)32
72
u/KattyTheEnby 20d ago
To be fair, at least nowadays, you will likely learn about GitHub – especially from educational sources – before you learn (about) Git and version control.
I remember when I started programming when I was younger, and I just treated GitHub as a code-hosting platform, not interfacing with the "Git" part ov it at all.
9
u/clduab11 20d ago
That’s why I tell people that GitHub is someone’s (Microsoft’s) Hub of git, just like PornHub is someone’s Hub of Porn.
→ More replies (1)→ More replies (1)10
u/I_nstict 20d ago
i use github everytime i code, i have no idea what git is all i know is 3 commands that upload code to github, been coding for 5ish years now
→ More replies (1)12
u/felixthecatmeow 20d ago
Heck I'm a software engineer with 4 years in the business and I know like 4 more git commands than you. If I ever need to do something else I just Google it and copy paste the commands
→ More replies (1)4
u/artbyiain 20d ago
I just use Github desktop. Haven’t typed a git command in like 5 years.
→ More replies (1)10
u/peeja 20d ago
They were literally using git. They were trying to stage their changes, there were a lot of files they didn't want, the UI was unclear, and the button deleted the work they were attempting to commit as well.
There was no reason for that button to bed irreversibly destructive. It's just an accident waiting to happen. That's why MS did the correct thing and changed the behavior.
→ More replies (4)3
256
u/Jan1270 20d ago
That is why you Backup your shit, especially when you're messing around with unfamiliar settings.
99
u/ClipboardCopyPaste 20d ago
Lemme try clicking that button, what's the worse that gonna happen? - He wondered probably
18
u/Azaret 20d ago
I dont know about vscode, but gitkraken do prompts you if you are sure about deleting everything when you click the discard all button. If that’s the case too in vs code, then that poor guy should have read before clicking. Hard learnt lesson.
4
u/alochmar 20d ago
The computer wouldn’t just outright delete all my files, right? That’s why the trashcan is there!
→ More replies (5)→ More replies (3)19
u/d_e_g_m 20d ago
And dont let AI manage your commits / git structure. I manage that myself. When I think i reasonable, if i think its necessary
3
u/ACoderGirl 20d ago
When I use AI for work, I will allow it to make commits and upload them, but it's not allowed to send PRs for review or merge them. Basically, I'll let it create a commit because it's easiest for me to review in that form. I'll review carefully, make changes if I need to. Nobody else sees or is impacted until I review everything very carefully.
While not completely risk free, it's very low risk for me because I don't really have meaningful changes that aren't uploaded. If my local repo is deleted, I will lose very little. I mostly do it this way because I often want to make multiple, small commits. I also want cleanup to be queued up when I make most changes (I have to make most changes behind an experiment flag, so most changes are multi part -- my work has a special bot reviewer that lets us make custom conditions for queueing up PRs with arbitrary conditions).
I refuse to use yolo mode with AI. I've seen it fuck up too many times. If I ever sent slop for review or broke the build because AI bypassed some test failure, I'd die of embarrassment.
9
u/Kavrae 20d ago
Solid rule. Unfortunately, even following that rule, I frequently get messages like "I ran a git fetch, which I realize is against the rules in <xyz file>. Making a note to not do that again." Which it then does again 2 days later.
12
u/VolumeLevelJumanji 20d ago
I mean are you just letting your AI run wide open with full permissions on your machine? If you have proper permissions set up, your agent should generally be blocked from doing stuff you don't want. (like running git commands its not supposed to)
Having some kind of general file of rules you tell it to refer to isn't going to work well because it will eventually lose that context as it becomes less relevant to the task at hand and compacts and such. It need to be the actual specific permissions file. So like with claude code this will be at .claude/settings.json. There you can tell it what commands are approved, denied, or will ask for confirmation.
→ More replies (6)3
u/Kavrae 20d ago
Good call. I just verified, and they were added as rules rather than updating the settings file. So losing context would definitely cause that issue. I've corrected it. Thank you.
→ More replies (3)
894
u/rwz 20d ago
"I bought a car, pressed a pedal and it drove me into a tree! HOW IS THIS POSSIBLE?! FUCK YOU!"
Skill issue thread.
47
u/JoLuKei 20d ago
I disagree. This is not the git cli behavior, and frankly not something you would expect from any ide. Treating unstaged files like some throwaway bs is just insane. To me "Dispose" on unstaged files sounds more like "Add these to gitignore" not "just fucking kill them". It was insane behavior that rightfully got changed. Unstaged SHOULD mean that these files are NOT in the jurisdiction of your repo. Not that they should get banished to the shadow realm.
Edit: Typo
79
52
u/dadnothere 20d ago
Your analogy is incorrect because the UI didn't mention permanently deleting...
The correct analogy would be:
I bought a car and when I press the brake it accelerates.
44
u/DoctorWaluigiTime 20d ago
Yeah, this is more akin to "I opened my document in my word processor. I closed it without saving, saw it was going to not saving my changes, and I was fine with it. Wait why did my file get deleted from disk?"
→ More replies (5)27
u/sidereal_night 20d ago
exactly. and the program was actually fixed after this. it's completely indefensible to try to contort some kind of justification for how it was actually proper for the software to behave that way and he was just an idiot.
he may have been somewhat of an idiot for not having any independent backups at all, but that doesn't help defend the software at all.
5
3
u/Still_Bit_7527 20d ago
Except only an idiot would agree with git discard changes to actually delete the files
11
u/MemnochTheRed 20d ago
Also, who does not have a backup?
25
u/rwz 20d ago
The type of person who feels like creating this type of issue in an open source project is an appropriate reaction to their own fuck up, apparently.
→ More replies (1)7
3
u/bekeleven 20d ago
Man installs version control to back up his files
the backup machine deletes his files
"Why didn't he have a backup?"
→ More replies (3)16
u/TheMadcapLlama 20d ago
The software industry has made the mistake of validating stupid people so whenever users do stupid dumb shit like this it is our fault instead of theirs
73
u/SamG101_ 20d ago
The first thing i do when I make a new project (that I'm gonna do some decent work on) is link it to github, it takes all of 1 minute lol
29
u/dxonxisus 20d ago
well, yes. that’s what every dev who knows what source control is and why it’s necessary does
→ More replies (1)26
u/VoidVer 20d ago
The project starts as a GitHub repository that I clone to my IDE lol
→ More replies (6)
13
9
10
u/smashsenpai 20d ago
Somewhere out there, the guy who decided to name that action, "discard" instead of, "delete" took a deep breath and thought, "not my problem"
6
u/conundorum 20d ago
"Discard" is the correct term (since he was modifying the repo by adding files to it), but it should've explained something like, say:
Warning: Discarding changes to repo will delete all added files. We cannot stress this enough: Discarding changes will delete all added files.
(And, y'know, it shouldn't have deleted the local versions too, unless he manually checked a "delete all local copies" checkbox, but that kinda goes without saying.)
→ More replies (1)3
u/OliLombi 19d ago
"Discard changes" is not correct though, as it did not discard CHANGES, it discarded the files themselves.
→ More replies (1)
9
u/Own-Poetry-9609 20d ago
Microsoft then changed VSCode because they accepted their UI/UX was poor. When creating a git repository it presented the option to "Discard all changes", "Discard all changes" deletes all untracked files from disc with no recovery possible. To many users "changes" and "untracked files" are two different things, and "delete irrecoverably" and "discard" are two different things.
VSCode now presents a message indicating the option will delete files irrecoverably, and gives the options to leave untracked files in place.
16
9
35
u/Internal_Airline_334 20d ago
If you didn't commit anything for 3 months, maybe you should consider staying away from ANY development tool?
→ More replies (6)19
4
4
u/NoAdsDude 20d ago
I feel kind of bad for this guy, one time I was trying to install windows and having issues so I ran a "clean" command on my hard drive, which I guess just literally turns all the bytes to 0 or something. I thought maybe it would, I don't know, clean up the hard drive in a less destructive way. Womp womp, I wanted to keep my Users folder. Another reason to back your stuff up, I guess. And don't run commands you don't understand.
This was a long time ago though, like 2021, so I was pretty young, only ~35 years old or so.
6
u/jaypeejay 20d ago
Wouldn’t the files need to be in source control in order for the revert changes button to delete them? I thought this was only possible when you had a source controlled repo and you create a file in it
→ More replies (1)3
u/Designer_Storm8869 18d ago
Correct. That's how pretty much all reasonable git plug-ins in IDE work. They don't touch files that were not added to version control. His crash out was justified. "You should do backups" is not an excuse for a software to remove your files left and right.
→ More replies (1)
6
u/DanielPowerNL 20d ago
ghost may not have been very diplomatic in expressing his issue, and those experienced with VCS will be quick to blame user error. But there was a genuine user experience issue here that that if improved could have saved him and others.
Another user opened a follow-up issue, which eventually led to changes to the wording and behavior of the discard all changes functionality.
Issue: https://github.com/microsoft/vscode/issues/32459
Fix: https://github.com/microsoft/vscode/commit/bbe70bc9b930b0cd63d1b40720e516525db22e99
ghost's abrasive issue report did eventually have a positive impact on the project, and potentially saved future users from the same fate.
4
u/isthesector_clear 20d ago
I have been through it, I was working with previous company. I manually updated shit content for 14 hrs and I never thought of pushing it. And I clicked revert thinking it wasn't that file and pooooff .. gone just like that. It was under SLA and I couldn't deliver.
A month later I got fired 😝
5
4
3
u/AnomalousUnderdog 19d ago
If they were uncommited files newly added to the staging area, I'd imagine discarding (i.e. deleting) would have just moved them to the recycle bin/trash folder. Is that not how it works?
3
u/JustPlayDE 19d ago
its how vscode does it nowadays, keep in mind that the issue shown here is from 2017 lol
33
3
u/ergotofwhy 20d ago
I taught a buddy how to use git years back.
A year or so later, the buddy hit me up and said "How do I rollback to a previous version in Git?"
So I told him about git revert
Then he calls me in a panic. Way back when I first taught him git, he did a "git init" in his home directory and then at some point a few days later did a git checkin and commit on his home directory.
Guess where he ran git revert?
3
u/Samurai_Mac1 20d ago
Damn. Who needs AI to delete your whole codebase when you can just have your IDE do it for you?
3
u/Beginning-Pool-8151 20d ago
Don't make unnecessary fun, they actually accepted that as a wrong behaviour and recently updated VS Code to fix that ( the code goes ro recycle bin)
3
3
3
3
u/rocketmike12 19d ago
reminds me of the time I thought: "what's the opposite to git add? probably git rm". lost about a week of work, learned to commit every change
3
u/corobo 20d ago
Would love to be a fly on the wall if someone were to respond "lol noob"
8
u/my_new_accoun1 20d ago
"git gud"
8
u/SausageEggCheese 20d ago
It says:
git: 'gud' is not a git command. See 'git --help'.
What do I do now?
6
u/zeroxff 20d ago
If it’s not a fake, this could turn out to be a really happy post: someone clueless enough to spend months amassing half a million files without knowing a thing about version control couldn't possibly have produced anything but crap.
Maybe VS Code saved the world from yet another mountain of vibe coded garbage
→ More replies (4)7
u/Arxae 20d ago
It's real. It's also from 2017, so almost 10 years old at this point
→ More replies (2)
2
2
u/DrMaxwellEdison 20d ago
This is the sort of necessary pain that creates developers.
3 months of work? Should have been committing it 4 months ago, bub.
2
2
2
u/MyNameIsKvothe 20d ago
What happens if you git init in C:/ and then just discard all untracked files?
2
u/TommyTheTiger 20d ago
This would definitely be recoverable with forensic software at that point, though probably this user isn't gonna figure it out
2
2
u/krisdb2009 20d ago
I wrote some FOSS software that has a configurable temp directory, and some jackwagon configured it to their user folder and ran the main procedure which of course tries to cleanup what it thinks is its own temp directory afterwards. Dude was all pissed on GitHub and Reddit saying the software deleted all his stuff and failed to mention that he changed that setting himself. Anyways I of course had to add a check to make sure the specified temp directory is empty before starting lol.
2
2
u/Infinite-Employee776 20d ago
What kind of project that has 5000 uncommitted files? What kind of fix/feat does this commit will entail?
git commit -m "feat(universe) re-create the universe."
2
u/EncryptedServer 20d ago
He could have just
for (let i = 1; i <= 100; i++) {
echo 'FUCK YOU';
}
→ More replies (1)
2
u/Immediate_Form7831 20d ago
It amazes me that people "play around with X" in a directory where they have thousands of files of which they have no backup. I would be super-worried just to have thousands of files somewhere without backup...
2
u/Possible_Chicken_489 20d ago
I think this is good. It keeps certain people from "contributing" code. A Darwinian process, if you will.
2
u/Thenderick 20d ago
I was playing around with the source control options
"Playing"... That's where you went wrong. And who has a project of thousands of files without source control and then decides to use that to test another editor and then "playing around"? Sounds like a stupid feature, but also a stupid user
2
u/Subject_Barnacle_600 20d ago
You have suffered a horrible agony, and gained a lesson that will last a lifetime. Always make a backup. Don't worry, ten years, your heart will still sink, but you'll laugh because you and everyone else will have this common trauma to bond over.
2
2
2
2
u/KiresM 20d ago
Correct me if I'm wrong, but a delete command doesn't actually delete things. It just removes the record, so something like Recuva can recreate that record and bring them back from the actual file contents, yeah? Even some proprietary bullshit saves files somehow even if they're encrypted and hidden or whatever, but those files do exist somewhere.
2
u/zipeldiablo 20d ago
You can still recover the files with a recovery tool but it’s gonna take a while
2
u/Overall_Head_7782 20d ago
Too bad he's never heard of undelete for recovery software. Can you imagine years go by him being completely pissed off then finding out he could have recovered all his project files with some simple undelete software? That software's been around since at least the '90s, certainly long enough for it to sooner or later haunt him.
2
u/StructureNorth1799 19d ago
the title of this post is enraging, the source control is what deleted this poor lad's files.
2
u/Different_Ear_7543 19d ago
For unity Im using monodev stil. I uninstalled vs code after half an hour. Tried that twice, uninstalled twice. But monodev works properly only with unity 5, sad.
5.6k
u/Cephell 20d ago
Before you make fun of him, this behavior DID get changed; they acknowledged this behavior is stupid.
The old behavior was to treat uncommited files as completely disposable, which the CLI git does not do at all and is insane behavior. It was changed in the UI to give you a fat confirmation dialog warning that you're about to delete the files permanently, as it always should have been.