• aliser@lemmy.world
    link
    fedilink
    arrow-up
    28
    ·
    14 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.

    • expr@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      2 hours ago

      Yeah, standard practice is to set up source control before doing any work at all. Then you add whatever project template/scaffolding files to an initial commit and make it, and keep committing from there.

      You should always be committing early and often. Saves you a lot of headache and make it a lot easier to clean up your history later too.

      • CaptPretentious@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        3 hours ago

        Viscose is absolutely fine.

        Most of these comments can be reduced to either

        1. I use CLI by the way…

        2. Hating on vscode because it’s Microsoft product and for no other reason.

        A Gitlab/GitHub account is free. Vscode absolutely lets you type git commands if you prefer that, The GUI only provides access to the most common actions you will do. And I could be wrong on this, but I feel like the discard button does prompt the user that the files will be permanently deleted and you have to click okay. But maybe that only applies to tracked files, not sure off the top of my head.

      • locuester@lemmy.zip
        link
        fedilink
        English
        arrow-up
        7
        ·
        8 hours 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
        9
        arrow-down
        1
        ·
        10 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.

      • Cethin@lemmy.zip
        link
        fedilink
        English
        arrow-up
        2
        ·
        8 hours ago

        (VS)Code(ium) is great. (VSCode is MS fork of the OSS Codium.) It’s a popular editor with a lot of plugin for just about every language. It has an integrated console. It can do basic Version control (and you can use the console for anything more). It’s my favorite editor/IDE (not technically and IDE, at least out of the box). Just don’t do things you don’t understand. It’s that simple. The OP fucked around, and they found out what it does the hard way. It’s really easy to use if you have a basic understanding of things though.

        • Txmyx
          link
          fedilink
          arrow-up
          2
          ·
          6 hours ago

          /((vs)|(visual ?studio)):? ?(cod(e|ium)?)/igm

      • tiredofsametab@fedia.io
        link
        fedilink
        arrow-up
        6
        ·
        11 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).