• _____@lemm.ee
    link
    fedilink
    English
    arrow-up
    42
    ·
    2 hours 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

    • MajorasMaskForever@lemmy.world
      link
      fedilink
      English
      arrow-up
      6
      ·
      33 minutes ago

      Every time I mentor a dev on using git they insist so much on using some GUI. Even ones who are “proficient” take way longer to do any action than I can with cli. I had one dev who came from SVN land try and convince me that TortoiseGit was the only way to go

      I died a little that day, and I never won her over to command line despite her coming to me kinda regularly to un-fuck her repository (still one of the best engineers I ever worked with and I honestly miss her… Just not her source control antics)

      • dave@feddit.uk
        link
        fedilink
        English
        arrow-up
        1
        ·
        8 minutes ago

        So I’m normally a command line fan and have used git there. But I’m also using sublimerge and honestly I find it fantastic for untangling a bunch of changes that need to be in several commits; being able to quickly scroll through all the changed files, expand & collapse the diffs, select files, hunks, and lines directly in the gui for staging, etc. I can’t see that being any faster / easier on the command line.

    • Cethin@lemmy.zip
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      3 minutes 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.

  • mvirts@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    5 minutes ago

    Obligatory mention of file recovery as an option if you get in this situation.I recommend testdisk but there are other more gui friendly options.

    NTFS takes a relatively long time to destroy the data so chances of recovery are good on Windows.

  • AnAmericanPotato@programming.dev
    link
    fedilink
    English
    arrow-up
    64
    ·
    4 hours ago

    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.

    • Omega_Jimes@lemmy.ca
      link
      fedilink
      arrow-up
      26
      arrow-down
      2
      ·
      3 hours ago

      I’m not great at English, but “discard all changes” shouldn’t ever mean “Delete”.

      • Michal@programming.dev
        link
        fedilink
        arrow-up
        16
        arrow-down
        5
        ·
        2 hours ago

        In the context of version control it does. Discarding a change that creates a file means deleting the file.

        • Omega_Jimes@lemmy.ca
          link
          fedilink
          arrow-up
          1
          ·
          7 minutes ago

          Ok fair enough, but I’m under the impression these files existed before the source control was implemented.

          I guess it’s all up to how the program handles existing files.

    • cocobean@bookwormstory.social
      link
      fedilink
      English
      arrow-up
      26
      ·
      3 hours ago

      Also, why not send them to the recycle bin? I never really thought about it before, but that does seem a reasonable UX improvement for this case

      • murtaza64@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        1 hour ago

        I wonder if there’s already a git extension to automatically stash the working tree on every clean/reset/checkout operation…

      • stetech@lemmy.world
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        2 hours ago

        Because “the underlying Git nukes them right away, so why shouldn’t we perma-delete the files, too?”

        Anything else’d be effort…

  • LANIK2000@lemmy.world
    link
    fedilink
    arrow-up
    8
    arrow-down
    5
    ·
    1 hour ago

    Honestly no idea why someone would go around a completely unknown menu in a new unknown editor and randomly click things with caution completely out the window. Not having a copy or trying a blank project, not even reading any messages. I mean even if we don’t know it’s a nuke button, God knows what other edits it could do to your code without you knowing.

    This goes beyond rookie mistake. This is something 12 year old me would do. Same with the issue page being 90% swear words.

    • calcopiritus@lemmy.world
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      48 minutes ago

      I don’t even know why people ITT are blaming the IDE and completely ignoring this.

      When you learn git, you do so on a dummy project, that has 5 files which are 10 characters long each.

      An IDE is not made so you can’t break things, it is tool, and it should let you do things. It’s like complaining that Linux will let you delete your desktop environment. Some people actually want to delete your desktop environment. You can’t remove that option just because someone can accidentally do it by ignoring all the warnings.

  • Artyom@lemm.ee
    link
    fedilink
    arrow-up
    17
    arrow-down
    3
    ·
    4 hours ago

    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.

    • Korne127@lemmy.world
      link
      fedilink
      arrow-up
      31
      ·
      3 hours ago

      The person didn’t have any git repository; probably a new programmer that didn’t know how version control works and just clicked discard without understanding what that means in this situation.

      • ByteOnBikes@slrpnk.net
        link
        fedilink
        arrow-up
        6
        arrow-down
        1
        ·
        1 hour ago

        This person is why we have that meme where devs would rather struggle for a week than spend a few hours reading the documentation.

  • aliser@lemmy.world
    link
    fedilink
    arrow-up
    24
    ·
    6 hours ago

    deleted a chunk of my work the other day by pressing Ctrl z in windows explorer. my project was without source control installed (cuz it was in Dev stage), and Ctrl shit z/Ctrl y hotkeys didn’t work, so that chunk was just gone, persished forever… or so I though. I remembered vs code having a file history under some panel. found it, and here it was - at least some of the latest history of my file. lesson learned: even in Dev where nothing is yet working, finish your day of coding with a commit to a remote repo.

      • locuester@lemmy.zip
        link
        fedilink
        English
        arrow-up
        1
        ·
        22 minutes ago

        Makes no sense to me. I’ve never had a single problem. Best ide I’ve ever used.

      • Dragon Rider (drag)@lemmy.nz
        link
        fedilink
        English
        arrow-up
        5
        ·
        2 hours ago

        You can avoid this problem by not doing version control in your code editor. Different programs for different purposes. VS Code is fine for editing code and should not be used to manage an entire project.

      • tiredofsametab@fedia.io
        link
        fedilink
        arrow-up
        5
        ·
        3 hours ago

        I begrudgingly switched to vscode a few years ago. I’ve never had any issues like this with it. My only issues have been with a plugin that I installed optionally (and that was later fixed by the plugin author).

    • Korne127@lemmy.world
      link
      fedilink
      arrow-up
      8
      arrow-down
      1
      ·
      3 hours ago

      The person didn’t have any git repository; probably a new programmer that didn’t know how version control works and just clicked discard without understanding what that means in this situation

    • Mixel@feddit.org
      link
      fedilink
      English
      arrow-up
      73
      ·
      10 hours ago

      I have heard things from another apprentice who just does not use version control at all and the only copies are on his laptop and on his desktop. He is also using node.js with only 1 class and doesn’t know about OOP (not sure if you even use that in js no clue 😅) and has one big file with 20k lines of code I have absolutely no clue how he navigates through it

      • LANIK2000@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        edit-2
        2 hours ago

        Ey! Reminds me of my middle-school years! I still can’t belive I made an entire game without a single class… Just storing info in arrays and writing in comments what location represents what data. But I was a literal child, too young to read guides or sit through “long” tutorials.

        I don’t want to sound too mean, but whenever I see anything similar at work, I wish that person get a job they’re actually good at. It’s fine and all that the company started hiring actual programmers to fix things, but the fact that the old crew still fucks shit up with senior privileges is a major grievance.

      • e8d79@discuss.tchncs.de
        link
        fedilink
        arrow-up
        62
        ·
        9 hours ago

        I know the type. Usually the kind of confident know-it-all who refuses to learn anything but delivers changes really quickly so management loves them. I had the misfortune to fix such a project after that ‘rock-star’ programmer left the company. Unfortunately the lack of professional standards in our industry allows people like that to continuously fail upwards. When I left the project they rehired them and let them design the v2 of the project we just fixed.

        • LANIK2000@lemmy.world
          link
          fedilink
          arrow-up
          4
          ·
          2 hours ago

          Jesus, reminds me of a similar story. My gf once lost a job to someone who literally just pasted code into LLMs, also delivering quickly, even tho it was hot garbage. Anyhow, she spent a lot of her time fixing his shit and so her output went down. I hope that company burns to the ground with completely un manageable software.

        • MajorHavoc@programming.dev
          link
          fedilink
          arrow-up
          7
          ·
          4 hours ago

          When I left the project they rehired them and let them design the v2 of the project we just fixed.

          Lol. Wow.

          And that is why I’ve been unable to work myself out of a job in all my long years as a developer.

        • RagingRobot@lemmy.world
          link
          fedilink
          arrow-up
          9
          ·
          5 hours ago

          My company for the longest time had two engineers they would give all the new projects to. They would rush through some prototype code as fast as they could then management would bring in a new team to take the project over. The code was always garbage and crammed into one place. I kept getting new projects and instead of starting from a nice clean slate we always had to build on that garbage. It sucked so bad.

      • Blackmist@feddit.uk
        link
        fedilink
        English
        arrow-up
        11
        ·
        6 hours ago

        Those are rookie numbers. I have at least a 35k one somewhere. More than one actually.

        People run their businesses on this.

        • fibojoly@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          47 minutes ago

          I once landed a job at a small company doing a software for medical analysis labs all over the country. Software had been around for over ten years at this point. They had no source control. Nothing. Absolute nightmare.
          They were literally starting to use source control when I arrived.
          In 2015.

  • onlinepersona@programming.dev
    link
    fedilink
    English
    arrow-up
    51
    arrow-down
    9
    ·
    9 hours ago

    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

    • Zagorath@aussie.zone
      link
      fedilink
      English
      arrow-up
      32
      arrow-down
      3
      ·
      7 hours ago

      I understand the impulse to be empathetic and kind. But it’s very hard to respond in good faith to someone who just made a post where more than half the words are “fuck you”.

      • madcaesar@lemmy.world
        link
        fedilink
        arrow-up
        24
        arrow-down
        4
        ·
        7 hours ago

        A feature that permanently deletes 5000 files with one click without warning deserves a fuck you.

        • BatmanAoD@programming.dev
          link
          fedilink
          arrow-up
          15
          arrow-down
          2
          ·
          7 hours ago

          It had a reasonably clear warning, though; a screenshot is included in this response from the devs. But note that the response also links to another issue where some bikeshedding on the warning occurred and the warning was ultimately improved.

          • Buddahriffic@lemmy.world
            link
            fedilink
            arrow-up
            4
            ·
            2 hours ago

            I disagree that that warning is reasonably clear. Even the comment that included it has the line of thought, where the user, not knowing what terms git uses thinks that they just did an action that is going to change each of their files. It makes sense that they’d want to discard those changes. That user then goes on with some snark about not wanting to learn any more about what they are playing with and that other programs would do the same, but “discard changes” seems like it would have a clear meaning to someone who doesn’t know git.

            The warning says it isn’t undoable but also doesn’t clarify that the files themselves are the changes. Should probably have a special case for if someone hits discard changes on a brand new repository with no files ever checked in and hits discard on a large number of files instead of checking them in. Even a “(This deletes all of the local files!)” would make it clear enough to say what the warning is really about.

            • friendlymessage@feddit.org
              link
              fedilink
              arrow-up
              2
              ·
              1 hour ago

              Even if you know git, you wouldn’t assume that “discard all changes” affects untracked files. It’s bad design all around

          • ClassifiedPancake@discuss.tchncs.de
            link
            fedilink
            arrow-up
            1
            ·
            1 hour ago

            If you have no idea what Git is, that warning message is not telling you you’re about to delete 5000 files.

            But I wonder if this person maybe does know about Git because they used the word „stage“.

          • tfw_no_toiletpaper@lemmy.world
            link
            fedilink
            arrow-up
            13
            ·
            6 hours ago

            OK this is hilarious

            When you sell hammers you’ll likely have people using them to hit their own heads, which, understandably, they will put the hammer at fault. Now, we already put a big don’t hit this on your own head label on our hammer. Should we actually prohibit people from head hitting with our hammers? Probably not, since some users still want to hit heads with it. It’s just how hammers work.

    • CosmicTurtle0@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      12
      arrow-down
      7
      ·
      6 hours ago

      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.

      • rothaine@lemm.ee
        link
        fedilink
        arrow-up
        10
        ·
        3 hours ago

        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.

    • eating3645@lemmy.world
      link
      fedilink
      English
      arrow-up
      93
      ·
      10 hours ago

      Steps to Reproduce:

      1.Go near this fucking shit editor.

      2.Commit the deadly sin of touching the source control options.

      🤣

        • Hawke@lemmy.world
          link
          fedilink
          arrow-up
          88
          arrow-down
          2
          ·
          10 hours ago

          I dunno, “discard changes” is usually not the same as “delete all files”

          • josefo@leminal.space
            link
            fedilink
            arrow-up
            1
            arrow-down
            2
            ·
            3 hours ago

            If the “changes” are all your files, discarding them for me means basically delete my files, you know, the ones you are trying to add.

            • T156@lemmy.world
              link
              fedilink
              English
              arrow-up
              8
              ·
              edit-2
              3 hours ago

              At the same time, OP seems a layman, and might be coming from things like Microsoft Word, where “Discard all changes” basically means “revert to last save”.

              EDIT: After reading the related issues, OP may have also thought that “discard changes” was to uninitialise the repository, as opposed to wiping untracked files.

          • bleistift2@sopuli.xyz
            link
            fedilink
            English
            arrow-up
            19
            ·
            10 hours ago

            Nowadays the warning even says that this cannot be undone. Maybe that wasn’t present in 1.15, though.

            • TopRamenBinLaden@sh.itjust.works
              link
              fedilink
              English
              arrow-up
              22
              ·
              5 hours ago

              It was. If you go through the OP thread, one of the responses is a picture of the dialog window that this user clicked through saying, “these changes will be IRREVERSIBLE”.

              The OP was just playing with a new kind of fire (VSCodes Git/source control panel) that they didn’t understand, and they got burned.

              We all gotta get burnt at least once, but it normally turns us into better devs in the end. I would bet money that this person uses source control now, as long as they are still coding.

            • Hawke@lemmy.world
              link
              fedilink
              arrow-up
              64
              arrow-down
              3
              ·
              9 hours ago

              “Changes” are not the same thing as “files”.

              I’d expect that files that are not in version control would not be touched.

              • MajorHavoc@programming.dev
                link
                fedilink
                arrow-up
                9
                ·
                edit-2
                2 hours ago

                Yeah. That’s discussed in more detail in the code change that resulted from the issue report.

                It’s a ballsy move by the VSCode team to not only include git clean but to keep it after numerous issue reports.

                As others discussed in that thread, git clean has no business being offered in a graphical menu where a git novice may find it.

                That said, I do think the expanded warning mesage they added addresses the issue by calling out that whatever git may think, the user is about to lose some files.

              • EleventhHour@lemmy.world
                link
                fedilink
                English
                arrow-up
                11
                arrow-down
                1
                ·
                edit-2
                9 hours ago

                Apparently, it means changes to the directory structure and what files are in them, not changes within the files themselves. It really ought to be more clear about this.

              • Pyro@programming.dev
                link
                fedilink
                arrow-up
                10
                arrow-down
                6
                ·
                edit-2
                9 hours ago

                “Changes” encompass more than you think. Creating / Deleting files are also changes, not just edits to a file.

                • If the change is an edit to a tracked file, “Discard Changes” will reverse the edit.
                • If the change is deleting a tracked file, “Discard Changes” will restore it back.
                • If the change is a new untracked file, “Discard Changes” will remove it as intended.

                It can also be all of them at the same time, which is why VSCode uses “Changes” instead of “Files”.

                • candybrie@lemmy.world
                  link
                  fedilink
                  arrow-up
                  6
                  ·
                  5 hours ago

                  If the change is a new untracked file

                  Wasn’t the issue that it deleted a bunch of preexisting untracked files? So old untracked files.

        • Miles O'Brien@startrek.website
          link
          fedilink
          English
          arrow-up
          16
          arrow-down
          3
          ·
          10 hours ago

          Having done exactly 0 research, I going to assume it’s one of those “DO NOT PRESS OKAY UNLESS YOU ARE EXPERIENCED AND KNOW WHAT YOU ARE DOING” and someone went “pffft I know what I’m doing. click now what does this option do…”

          • bamboo@lemmy.blahaj.zone
            link
            fedilink
            English
            arrow-up
            26
            ·
            10 hours ago

            reading through it, it sounds like they opened a project in VSCode, and it saw that there was a local git repo already initialized, with 3 months of changes uncommitted and not staged. So the options there are to stage the changes (git add) to be committed or discard the changes (git checkout -- .). I guess they chose the discard option thinking it was a notification and i guess the filename would be added to gitignore or something? Instead, it discarded the changes, and to the user, it looked like VSCode did rm -rf and not that this was the behavior of git. Since the changes were never committed, even git reflog can’t save them.

              • MajorHavoc@programming.dev
                link
                fedilink
                arrow-up
                5
                ·
                4 hours ago

                It appears that the behavior actually included a git clean. Which is insane in my opinion.

                Yeah. Building a convenient accessible context free way to run git clean…sure feels like the actions of someone who just wants to watch the world burn.

              • bamboo@lemmy.blahaj.zone
                link
                fedilink
                English
                arrow-up
                6
                arrow-down
                2
                ·
                7 hours ago

                Yeah, it’s unclear to me at the time if the dialogue box in the screenshot appeared when doing a select all operation, but it reads as though the OP dev didn’t understand git, discarded their work, and got upset that it was an option.

                Realistically if the dialogue box appeared, I’m not sure there would be anything else the IDE could do to prevent the dev from themselves. Perhaps reject operations affecting 5000 files? But then you’ll just have someone with the same issue for 4000 files.

                • Mad_Punda@feddit.org
                  link
                  fedilink
                  arrow-up
                  12
                  ·
                  edit-2
                  7 hours ago

                  The issue I linked has a very good analysis of the UX issues and several suggestions for fixing these. They went with a minor iteration on the original message box, which not only includes a clearer message and the number of files affected, but also defaults to not touching untracked files (while preserving the option to delete untracked files as before).

              • Scoopta@programming.dev
                link
                fedilink
                arrow-up
                2
                ·
                8 hours ago

                He said they’re not going to change it, just make the dialog a lot more clear and add a second button to it that will only do a reset without the clean.

        • elgordino@fedia.io
          link
          fedilink
          arrow-up
          7
          arrow-down
          1
          ·
          10 hours ago

          Pretty sure the scary warnings in big bold text are more recent than this report.

          • PostingPenguin@feddit.org
            link
            fedilink
            English
            arrow-up
            7
            arrow-down
            1
            ·
            10 hours ago

            Nope. The scary warning is even screenshotted and used as an example in the post report discussion.

            It’s quite the fun read!

      • Lazycog@sopuli.xyz
        link
        fedilink
        arrow-up
        5
        arrow-down
        1
        ·
        10 hours ago

        The dude ranted for awhile in the issue thread and closed the issue himself too! lol

    • Maven (famous)@lemmy.zipOP
      link
      fedilink
      arrow-up
      7
      ·
      10 hours ago

      This link was included in the post but I realize that “source” was probably not the best label for it. Updated to make it more clear.