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

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

  • AnAmericanPotato@programming.dev
    link
    fedilink
    English
    arrow-up
    44
    ·
    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
      21
      arrow-down
      1
      ·
      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
        10
        arrow-down
        2
        ·
        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
          ·
          15 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
      18
      ·
      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…

  • Artyom@lemm.ee
    link
    fedilink
    arrow-up
    11
    arrow-down
    1
    ·
    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.

    • Mixel@feddit.org
      link
      fedilink
      English
      arrow-up
      48
      ·
      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

      • e8d79@discuss.tchncs.de
        link
        fedilink
        arrow-up
        37
        ·
        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.

        • MajorHavoc@programming.dev
          link
          fedilink
          arrow-up
          4
          ·
          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.

      • Blackmist@feddit.uk
        link
        fedilink
        English
        arrow-up
        7
        ·
        7 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
          ·
          55 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.

    • Maven (famous)@lemmy.zipOP
      link
      fedilink
      arrow-up
      6
      ·
      11 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.

  • onlinepersona@programming.dev
    link
    fedilink
    English
    arrow-up
    35
    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
      20
      arrow-down
      2
      ·
      8 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”.

    • CosmicTurtle0@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      6
      arrow-down
      5
      ·
      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
        6
        ·
        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.

  • unalivejoy@lemm.ee
    link
    fedilink
    English
    arrow-up
    39
    arrow-down
    2
    ·
    11 hours ago

    Say you don’t know how to use git without saying you don’t know how to use git.

    • bjorney@lemmy.ca
      link
      fedilink
      arrow-up
      10
      ·
      9 hours ago

      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

    • ChaoticNeutralCzech@feddit.org
      link
      fedilink
      English
      arrow-up
      20
      arrow-down
      2
      ·
      edit-2
      2 hours ago

      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.

      • 4am@lemm.ee
        link
        fedilink
        arrow-up
        5
        ·
        7 hours ago

        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

    • Kaeru@slrpnk.net
      link
      fedilink
      English
      arrow-up
      7
      ·
      10 hours ago

      Alright you convinced me its time to pick up this skill. How does one best learn git? Just play around with it and break things?

      • LordPassionFruit@lemm.ee
        link
        fedilink
        arrow-up
        4
        ·
        9 hours ago

        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.

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

    Fuck around things you don’t understand, find out. Why even go near the source control area and start clicking stuff if you don’t know jack shit about it.

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

      It seems like he was trying to learn though? He clicked it, like “hell yes I want source control, let’s figure this out”

      “It says all my files are changed? Oh shit why did it change my files? Shit fuck, undo, how do I undo…Do I want to discard the changes? I don’t even know what it changed. Yes please undo whatever changes you did to my files”

      And poof.

    • filcuk@lemmy.zip
      link
      fedilink
      arrow-up
      1
      ·
      49 minutes ago

      Like, damn son, at least make a daily archive of your project??
      You have to expect things to go wrong, otherwise you have no one but yourself to blame.

  • BougieBirdie@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    14
    arrow-down
    1
    ·
    10 hours ago

    Often times, people learn that the stove is hot by touching it.

    It’s easier to blame the stove than the person who touched it. But if you laugh when you watch it happen, you’re probably not laughing at the stove.

    • BatmanAoD@programming.dev
      link
      fedilink
      arrow-up
      13
      arrow-down
      3
      ·
      10 hours ago

      The user clicked an option to “discard” all changes. They then got a very clear pop-up saying that this is destructive and cannot be undone (there’s a screenshot in the thread).

      • Peer@discuss.tchncs.de
        link
        fedilink
        arrow-up
        14
        ·
        10 hours ago

        I very much understand how one can think this would revert any changes done to files under version control but not delete the ones that are not. I believe this dialog has since been updated to explicitly state that fact.

        • BatmanAoD@programming.dev
          link
          fedilink
          arrow-up
          5
          ·
          7 hours ago

          Yes, the dialog was changed, as part of this linked issue (and maybe again after that; this whole incident is very old). After reading some of the comments on that issue, I agree with the reasoning with some of the commenters that it would be less surprising for that menu option to behave like git reset --hard and not delete tracked files.