• Lucy :3 ( 30p87@feddit.org ) 
          link
          fedilink
          arrow-up
          2
          ·
          1 year ago

          Huh? I’m talking about existing code being in a dir, then initting a git repo there, creating a pendant on your hoster of choice and then pushing it there. Wouldn’t cloning the repo from step 3 to the code from step 1 overwrite the contents there?

          • stembolts ( stembolts@programming.dev ) 
            link
            fedilink
            arrow-up
            6
            ·
            edit-2
            1 year ago

            There are multiple solutions to this without using --force.

            Move the files, clone, unmove the files, commit, push being the most straightforward that I can summon at this time… but I’ve solved this dozens of times and have never use --force.

            • Hoimo ( Hoimo@ani.social ) 
              link
              fedilink
              arrow-up
              3
              ·
              1 year ago

              If your remote is completely empty and has no commits, you can just push normally. If it has an auto-generated “initial commit” (pretty sure Github does something like that), you could force push, or merge your local branch into the remote branch and push normally. I think cloning the repo and copying the contents of your local repo into it is the worst option: you’ll lose all local commits.

          • dev_null ( dev_null@lemmy.ml ) 
            link
            fedilink
            arrow-up
            3
            ·
            1 year ago

            Yeah, I was thinking of a new repo with no existing code.

            In your case you’d want to uncheck the creation of a readme so the hosted repo is empty and can be pushed to without having to overwrite (force) anything.

  • dan ( dan@upvote.au ) 
    link
    fedilink
    arrow-up
    88
    ·
    1 year ago

    Before Git, we used SVN (Subversion), and CVS before that. Microsoft shops used TFS or whatever it’s called now (or was called in the past)

      • dan ( dan@upvote.au ) 
        link
        fedilink
        arrow-up
        21
        ·
        1 year ago

        Visual SourceSafe

        Yes! That’s the one I was struggling to remember the name of. My previous employer started on Visual SourceSafe in the 90s and migrated to Team Foundation Server (TFS) in the 2000s. There were still remnants of SourceSafe when I worked there (2010 to 2013).

        I remember TFS had locks for binary files. There was one time we had to figure out how to remove locks held by an ex-employee - they were doing a big branch merge when they left the company, and left all the files locked. It didn’t automatically drop the locks when their account was deleted.

        They had a bunch of VB6 COM components last modified in 1999 that I’m 80% sure are still in prod today. It was still working and Microsoft were still supporting VB6 and Classic ASP, so there wasn’t a big rush to rewrite it.

      • Yeah VSS was the predecessor to TFS, and now TFS is called Azure DevOps… whatever the fuck that means, Microsoft needs to get it together with product naming. Anyway TFS sucks major rotten ass. I have my problems with git - namely user friendliness - but TortoiseGit has put all those troubles to rest.

        Nothing like that can fix TFS.

          • I could go all day with my grievances… For some fucking reason, Team Foundation Server thought it would be a good idea to model their source control on folders and files rather than atomic nodes of changes like git.

            I’m sure someone thought this was intuitive, but it falls apart once you realize you can check in cross-branch or even cross-project files into a single changeset. This allows you to easily pollute projects you’re working on but didn’t intend to modify yet, if you forgot to exclude their files. And then, when your code reviewer checks the history of the project folder you modified, they don’t even notice all the files you changed that WEREN’T in that folder but were part of the same changeset. So you pass your review, and all the sudden there’s unwanted, unnoticed, and untested changes in some other project, with a nice code review stamp on them!

            And the entire checkout/checkin system is just flipping the read-only flag on the files in file explorer. It’s the most amateurish shit. If you edit a file in an open, active project, the file gets checked out automatically. But if you’re editing loose scripts that aren’t part of a bespoke SLN or CSPROJ, you have to check those out manually… which it will only tell you to do once you try to save the file.

            And then Visual Studio cannot understand that I might need to switch regularly between 2 types of version control systems. If you’re not on the same VCS plugin when you want to open a recent project on it, it doesn’t automatically switch it for you, it just refuses to load the project. The only way to reliably to switch is by going into the options menu, changing it there, THEN loading the project.

            git is practically made of grease compared to how stuttery and clunky TFS is. I’ll shed no tears for the fossils who are having a hard time learning git, they will be better off whether they realize it or not.

    • The_Decryptor ( The_Decryptor@aussie.zone ) 
      link
      fedilink
      English
      arrow-up
      9
      ·
      1 year ago

      A place I worked at did it by duplicating and modifying a function, then commenting out the existing one. The dev would leave their name and date each time, because they never deleted the old commented out functions of course, history is important.

      They’d also copy the source tree around on burnt CDs, so good luck finding out who had the latest copy at any one point (Hint: It was always the lead dev, because they wouldn’t share their code, so “merging to main” involved giving them a copy of your source tree on a burnt disk)

  • Artyom ( Artyom@lemm.ee ) 
    link
    fedilink
    arrow-up
    60
    ·
    1 year ago

    I just want to pause a moment to wish a “fuck you” to the guy who named an AI model “Cursor” as if that’s a useful name. It’s like they’re expecting accidental google searches to be a major source of recruitment.

  • yarr ( yarr@feddit.nl ) 
    link
    fedilink
    English
    arrow-up
    48
    ·
    1 year ago

    It’s a scary amount of projects these days managed by a bunch of ZIP files:

    • Program-2.4.zip
    • Program-2.4-FIXED.zip
    • Program-2.4-FIXED2.zip
    • Program-2.4-FIXED-final.zip
    • Program-2.4-FIXED-final-REAL.zip
    • Program-2.4-FIXED-FINAL-no-seriously.zip
    • Program-2.4-FINAL-use-this.zip
    • Program-2.4-FINAL-use-this-2.zip
    • Program-2.4-working-maybe.zip
    • Program-2.4-FINAL-BUGFIX-LAST-ONE.zip
    • Program-2.4-FINAL-BUGFIX-LAST-ONE-v2.zip
    • Jayjader ( Jayjader@jlai.lu ) 
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      From what I understand, you could un ironically do this with a file system using BTRFS. You’d maybe need a udev rule to automate tracking when the “Power Ctrl+Z” gets plugged in.

  • Just a heads up, it you don’t know how to use cli git in 2025 you’re probably a shit developer. There are undoubtedly exceptions, but I would argue not knowing version control intimately makes you a bad developer.

      • The fact that you don’t already know why and are dependent on GUI tools that you don’t fully understand is the reason that you’re probably not a very good developer.

        Git is incredibly powerful. Knowing why and how is infinitely valuable. Nothing about git cli is archaic or even particularly difficult to understand. Also the man page is very excellent.

          • Scary le Poo ( Scary_le_Poo@beehaw.org ) 
            link
            fedilink
            arrow-up
            4
            ·
            edit-2
            1 year ago

            I said that you are probably not very good. Your lack of git knowledge and your seeming inability to learn git means that you’ll likely never be able to function effectively in a development team and will only succeed in holding everyone back. Your lack of knowledge of version control overall is a massive point against you from the outset.

            If you’re a solo developer and never need to collaborate with other developers then good for you, but you lack of version control knowledge means that you’ll also probably end up being one of the ones crying that you lost 6 months of work because of stupid reason x y or z.

            Read up on fallacies, I did not use one. Your pathetic attempt to shoehorn anything that I said into a no true Scotsman fallacy just shows that you also have poor communication skills.

            Holy fucking shit. I didn’t even catch the bit at the end. You really think that cli arguments are archaic??? I’m going to go ahead and assume that regex has you scared shitless as well. Fuck me, you are not a good developer.

            Sidenote, something that will help you understand regex and you can test your strings against it in realtime, look up https://regexr.com/

      • expr ( expr@programming.dev ) 
        link
        fedilink
        arrow-up
        10
        ·
        1 year ago

        Because they are universally incapable of coming anywhere close to the full power of git.

        I can’t tell you how many times I’ve had GUI-only people ask me to unfuck their repo (fortunately not at my current job, because everyone uses the CLI and actually knows what they’re doing). It’s an impedance to actually learning the tool.

        Ultimately any GUI is a poor, leaky abstraction over git that restricts many of the things you can do for little actual benefit.

      • letsgo ( letsgo@lemm.ee ) 
        link
        fedilink
        English
        arrow-up
        10
        ·
        1 year ago

        Most cli stuff is a lot easier than programming. If you can’t use cli then by definition you’re a shit programmer.

        Of course if you simply don’t want to use cli that’s a different matter.

      • gamer ( gamer@lemm.ee ) 
        link
        fedilink
        arrow-up
        8
        ·
        1 year ago

        There’s nothing ‘archaic’ about git’s CLI. I think you might just be opposed to CLI’s in general, which is fine for a regular computer user, but paints a grim picture of your competency if you’re a developer.

        • WhatsTheHoldup ( WhatsTheHoldup@lemmy.ml ) 
          link
          fedilink
          English
          arrow-up
          4
          ·
          1 year ago

          That seems unnecessarily harsh.

          I find the built in controls with visual studio supremely convenient.

          After using git init --bare for the remote repo I use the built in git controls for branching and switching out as well as syncing and pushing. Why not, the button is right there and it’s literally faster.

          • The difference is that PRESUMABLY you aren’t utterly dependent upon it. If vscode utterly fucks your repo with a shit command, you’ll not really have any trouble fixing it. That’s the huge difference. The point is not that all GUI controls are always bad all of the time, the point is that you need to know what the hell you are doing in git as a basic tenant of developer competency.

      • ඞmir ( Amir@lemmy.ml ) 
        link
        fedilink
        arrow-up
        4
        ·
        1 year ago

        As someone using git for the last 10 years by now: you’re wrong. No UI has managed to give me access to all the fuckery I often do very quickly on the command line. I was honestly surprised to see IntelliJ nowadays supports an interactive rebase, but reflog, which should be a basic git feature, is still not widely supported in most IDEs in 2025. Or adding, resetting or checking out files with regex. Setting up and modifying lfs. And these are all basic features, good luck doing something like using branch~n syntax for some of the operations etc.

        Git UI is shit and will be for a long time.