• I feel bad for this kid. That really is a bad warning dialog. Nowhere does it say it’s going to delete files. Anyone who thinks that’s good design needs a break.

    Half the replies are basically “This should be obvious if your past five years of life experience is similar to mine, and if it isn’t then get fucked.” Just adding insult to injury.

    • It’s so fucking infuriating that so many devs act like this. “This should’ve been obvious!” Fuck off, that’s an unhelpful statement. “You should’ve been using version control! No backup, no sympathy!” Fuck off, they were literally trying to begin using version control for backups.

      Even half the comments on this very Lemmy thread are disparaging this dev. I wonder how many actually read the thread and found that there was a bug discovered causing this feature to delete files not even associated with git?

      But, congratulations to them, I suppose. Congratulations on making fun of someone. I hope it makes them feel powerful. 🙄 Devs can be so toxic.

    • Came here to say this. No one deserves this, not even new programmers who try to learn things.

      Some programming tools are really powerful compared to what new users are used to. If you come from the world of Microsoft Office and Apple whatever it’s called, everything is saved automatically to cloud and there is some local backup file somewhere which you can just restore. Modern programs are designed to protect users against their own mistakes, and when suddenly that is taken away, it can be a jarring experience.

    • If you’re going to use a git tool, you need to know how git works.

      There are 0 excuses for not having months of work in a repo, none. I have no sympathy whatsoever. How the fuck do you spend so many months without backing up your project or stuffing it in a repo?

      No sympathy. Dude is a shit developer and he learned an invaluable lesson.

      • My guess is that this is a teenager, and this is probably their first experience with git and version control in general. Just a hunch.

        Anyway, it is reasonable to expect a mainstream GUI app from one of the largest companies in the world to be approachable for people who do not know all the inner workings of the command line tools that are used behind the scenes. And it is reasonable to expect any destructive action to have clear and bold warnings. “Changes will be discarded” is not clear. What changes? From the user’s perspective, the only changes were regarding version control, so “discarding” that should leave them where they started — with their files intact but not in version control.

        Have mercy on the poor noobs. We were all there once.

      • If you’re going to use a git tool, you need to know how git works.

        I guarantee you at least half of git users would get glossy eyes as soon as you mention blobs and trees, yet they all still manage to use it daily successfully.

        There are 0 excuses for not having months of work in a repo, none. I have no sympathy whatsoever. How the fuck do you spend so many months without backing up your project or stuffing it in a repo?

        I need you to listen to me very carefully: THEY WERE FUCKING SETTING UP A REPO WHEN THIS HAPPENED.

  •  _____   ( @_____@lemm.ee ) 
    link
    fedilink
    English
    683 days ago

    let’s turn this into a constructive angle for future devs and current juniors: just learn git cli, I promise you it is much simpler than it seems.

    all those memes about git having like a thousand commands are true, but you really will only use like 7 at most per month.

    learn push, pull, merge, squash, stash, reset, im probably missing like one or two

    I promise you again: it is much simpler than it seems. and you won’t have to use these stupid git GUI things, and it will save you a hassle because you will know what commands you are running and what they do

    short disclaimer: using git GUI is totally fine but low-key you are missing out on so much

    • The main draw to the CLI for me is portability. I’ve been a dev for ten years now and used tons of different editors on different platforms and while each one had a different way to describe the changes, how to commit, or how to “sync” (shudder), the CLI hasn’t changed. I didn’t have to relearn a vital part of my workflow just because I wanted to try a different editor.

    •  Cethin   ( @Cethin@lemmy.zip ) 
      link
      fedilink
      English
      5
      edit-2
      3 days ago

      Personally, I’m pretty good with the CLI version, but sometimes I just use the Code VC interface. For some tasks (basic commit, pull, push) it’s pretty fast. I don’t know if it’s faster than CLI, but I switch between them depending on what I’m doing at that moment. Code has a built in console, so using either is pretty seemless and easy. If you only use the GUI you won’t ever understand it though. I think everyone should start with CLI.

      Honestly, this is true for almost everything. GUIs obfiscate. They don’t help you learn, but try to take control away so you can’t mess up, and as an effect can’t do everything you may want.

    • For me, it is easier to learn to use git via CLI instead of a UI. When I first started using git, I learned a few command/flag combinations that I use every day and I barely learned anything else about git after. Everything I don’t do regularly I don’t remember, but have written down in a text file of incantations. It is harder to write down what buttons and what menus I have to click.

  • While I have some sympathy for anyone who loses months of work, as an IT administrator by day, all I have to say about their lack of backups, and lack of RTFM before messing with shit is:

    HAHAHAHAHAHAHA HAHAHAHAHA. you got what you deserved fucker. GL.YF.

    • That’s what happens when people stumble across that website called GitHub, get hooked and now have unrealistic expectations for the real git.

      “I just installed Git for Windows. Where is the drag-to-upload box?”

      — A statement dreamt up by the utterly deranged

      Real git involves a lot of sweat, requires you to clean up any mess you make, and communicate with any partners about their preferred techniques instead of rawdogging it and waiting for issues. The pushing and pulling will come naturally but you need to know how and when to release, and be clear about how you wish to commit. Nightly is an option but good luck getting everyone on board. People might judge you for using the word “master” but it should be alright in private.

      • People might judge you for using the word “master” but it should be alright in private.

        I snorted. It was my inner 12-year-old’s fault. (Also because of recently some idiots getting up in arms about these terms in technology.)

      • involves a lot of sweat, requires you to clean up any mess you make, and communicate with any partners about their preferred techniques instead of rawdogging it and waiting for issues. The pushing and pulling will come naturally but you need to know how and when to release, and be clear about how you wish to commit. People might judge you for using the word “master” but it should be alright in private.

        Don’t talk about my mom that way

    • Git doesn’t automatically recursively add all files in the directory to the repository though - VSCode decided that should be the default behavior, while other editors (intellij) ask if you want to add newly created files to version control

      • That’s basically how I did it.

        To properly learn it using this method, create a directory that contains only text files and sub directories and treat it like a real project. Add files, delete them, play around with updating the repository. Try and go back a few updates and see how the things react. Since it’s not a real project there’s no risk of loss, but you’ll still get to see the effects of what you do.

  • The reactions here are why people don’t join forums, don’t ask questions, or choose to learn alone. “duh, I knew that”. Yes, the dude didn’t, which is exactly why he’s frustrated. I think too many have forgotten what it’s like to be a beginner and make a fatal mistake, which would explain the mocking responses here and things like recommending new linux users Arch.

    Anti Commercial-AI license

    • There is a difference between someone who is new and experiences something like their IDE deletes a file that was unexpected and asking a question about why it did that.

      Then there are arrogant assholes who believe their shit doesn’t stink and that they couldn’t have done anything wrong and it was the IDE’s fault for not knowing what they wanted to do versus what they commanded it to do.

      The OP is the latter.

      • I mean, not entirely, and he says he lost months worth of work. Like imagine you know nothing of git:

        • Click buttons in the IDE to add source control.

        • IDE says a bunch of files have been changed.

        • But I don’t want to make changes to the files, I want to source control them.

        • Attempt to undo the changes. Click “discard changes” thinking it will put them back to how they were before clicking add source control. Get a warning dialog that this is not undoable, but that’s fine because I don’t want whatever changes it made to my files anyway.

        • All files are deleted and unrecoverable.

        Like that experience sucks balls and it’s reasonable that a person wouldn’t expect “discard” == “delete”. Also, from reading the GitHub thread, apparently at that time VSCode was doing a git clean when you clicked this. Which like…yeah why the hell would it do that lol? I don’t think I have ever used git clean in my entire career.

        • Months worth of work. Going an entire day without committing should never happen. Also, rawdogging it without a backup?

          Nope, dude learned a hard lesson. No sympathy. He thought that the rules of data storage don’t apply to him and he got boned.

          • He did learn a hard lesson, but it sounds like this was exactly what he was attempting to rectify. “This project is pretty important to me. I should probably figure out how to use source control and put it on GitHub” but then by doing so, and due to some arguably poor UX decisions in VSC, destroyed the project.

            If someone’s trying to learn how to do something you can’t just be like “well you should’ve already known how”, you know what I mean?

            Well actually, let’s qualify that: there are cases where people try to jump right in the deep end. “I’m just learning woodworking! Step 1: build a new deck for my house”, like yeah bro what are you doing, let’s start with a birdfeeder or something.

            But that’s not what happened here. He tried to use the built-in GUI, which many would assume would be easier to learn than jumping right to the CLI, and it burned him in a way he didn’t even realize was possible.

  • Man I get paranoid about synchronization programs for this very reason. There’s usually some turnkey easy-mode enabled as soon as you first launch that’s like:

    “Hey you wanna back up your entire NAS to your phone?! That’ll be fun, right?!”

    And you’re like “…No.”

    And then it wants to obliterate everything so it’s all “synchronized”, often it’s not easy to find a “No, stop, don’t do anything at all until I configure this.” Option.

    iTunes was SO BAD about this.

    Syncthing is the least-bad sync software I’ve ever run. It’s got some footguns but it’s still brilliant.

    I would imagine there’s still ways to back up version controlled software right?

    • Any professional would have a code repository and probably a build server which spits out binaries left and right, off site of course.

      Bonus points if that is the easiest way to deploy the software, so all developers actually use it.

      Edit: typo

  • I don’t like how vs code thinks the world revolves around itself either. If I’m working on something, then checkout a different branch from a terminal, vs code sometimes undoes the “changes” on disk for open files and marks them as modified, infuriating. I never use the built in git functionality, as I find it more annoying than just using the command line in the first place, so thankfully it hasn’t deleted random files for me yet.

  • If you ever happen to have 5000 uncommitted files, you shouldn’t be asking yourself if you should commit more often. You should be asking yourself how many new repos you should be making.