• Punkie@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    8 months ago

    The thing is that for a majority of cases, this is all one needs to know about git for their job. Knowing git add, git -m commit “Change text”, git push, git branch, git checkout , is most of what a lone programmer does on their code.

    Where it gets complicated real fast is collaboration on the same branch. Merge conflicts, outdated pulls, “clever shortcuts,” hacks done by programmers who “kindof” know git at an advanced level, those who don’t understand “least surprise,” and those who cut and paste fixes from Stackexchange or ChatGPT. Plus who has admin access to “undo your changes” so all that work you did and pushed is erased and there’s no record of it anymore. And egos of programmers who refuse any changes you make for weird esoteric reasons. I had a programmer lead who rejected any and all code with comments “because I like clean code. If it’s not in the git log, it’s not a comment.” And his git comments were frustratingly vague and brief. “Fixed issue with ssl python libs,” or “Minor bugfixes.”

  • Ohi@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    8 months ago

    Aye, most of my 10 year career in web dev is pretty much those commands. However, some advanced git concepts are worth diving into. Stuff like git bisect that can narrow down the exact commit that broke your app is an absolute life saver. Knowing how to git cherry-pick is also a git skill professionals should be comfortable doing. Migrating work from one branch to another without merging the entire branch is pretty common.

    • seth@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      8 months ago

      It’s git push origin branch and then merge after submitting a pull request from branch to main after a successful lint check, build, deployment, and testing in a non-production environment, and PR approval. What kind of wild west operation allows pushing directly to main?

      • redcalcium@lemmy.institute
        link
        fedilink
        arrow-up
        2
        ·
        8 months ago

        Employees who push first win and get to leave early. The rest would be the suckers who would merge whatever mess left behind by the early employees.

      • MR_GABARISE@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        8 months ago

        What kind of wild west operation allows pushing directly to main?

        That’s kinda the whole point of trunk-based development.

    • RustyNova@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      8 months ago

      Fuck those that use main. If you’re working on a library fork that has main and a project that has master you’re bound to invert the two.

      “What do you mean I can’t checkout main? Oh right, here it’s master…”

      For once that we had a standard, it had to be ruined.

      • 1984@lemmy.today
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        8 months ago

        I think the reasons was ridiculous. The fact that people didn’t like the word master anymore. But I’m used to it now, so fine, let’s use main. It makes sensitive people feel better.

      • huginn@feddit.it
        link
        fedilink
        arrow-up
        0
        arrow-down
        1
        ·
        8 months ago

        Fuck those that use master. If you’re working on a library fork that has main and a project that has master you’re bound to invert the two.

        “What do you mean I can’t checkout main? Oh right, here it’s master…”

        For once that we had a standard, it had to be ruined.

        The standard is now main.

        • maynarkh@feddit.nl
          link
          fedilink
          arrow-up
          2
          ·
          8 months ago

          The standard is now main.

          Git itself does not use that standard yet, so at least now there are two competing standards.

          I get that there are cultural reasons why the word master was loaded language, but still, it’s not like institutional racism will go away. Meanwhile, the rest of the world which doesn’t struggle with the remnants of slavery has to put up with US weirdness.

  • gazter@aussie.zone
    link
    fedilink
    arrow-up
    0
    ·
    8 months ago

    As someone who knows that they know very little about git, this thread makes me think I’m not alone.

    • laurelraven@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      0
      ·
      8 months ago

      I think advanced git knowledge, like RegEx, is the exception, while the norm is to know the tiny handful of day to day useful bits

      • lhamil64@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        8 months ago

        How is regex git knowledge? I guess you can use regular expressions with git grep but it’s certainly not a git-oriented concept…

              • lhamil64@programming.dev
                link
                fedilink
                arrow-up
                0
                ·
                8 months ago

                Rereading it, I now understand what you meant. I interpreted the “like regex” as an example of advanced git knowledge. I’m not sure the comma helps make it unambiguous though.

                • laurelraven@lemmy.blahaj.zone
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  8 months ago

                  Yeah, reading it again and I can see that interpretation…

                  This is why you shouldn’t rely on yourself alone for proofreading your writing, I probably could have read that a hundred times and not seen another way to read it without someone else pointing it out

    • Trollception@lemmy.world
      link
      fedilink
      arrow-up
      0
      arrow-down
      1
      ·
      8 months ago

      What developer uses Linux in professional work? Maybe for on the side stuff but I haven’t seen any corporate Linux machines.

      • Solemn@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        1
        ·
        8 months ago

        Everywhere I’ve worked, you have a Windows/Mac for emails, and then either use WSL, develop on console in Mac since it’s Linux, or most commonly have a dedicated Linux box or workstation.

        I’m starting to see people using VSCode more these days though.

          • Ephera@lemmy.ml
            link
            fedilink
            arrow-up
            1
            ·
            8 months ago

            They’re both UNIX-like, i.e. they both implement the POSIX specification and are therefore in many ways compatible.

            But yeah, modern macOS is more directly derived from the original UNIX operating system.
            Linux was instead implemented from scratch to be compatible with UNIX.

      • Ephera@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        8 months ago

        The entire IT ecosystem is built around Linux, because it’s so prevalent in servers, containers, budget hardware and the open-source community.

        Yes, many companies don’t understand that and expect their devs to be productive on Windows. But in my experience, that’s an uphill battle.

        In my company, we get very little IT support, if we decide to order a Linux laptop and we still have significantly less trouble with getting things set up to start coding.
        Not to mention the productivity boost from having all the relevant technologies natively available + being able to script whatever you want.