• killeronthecorner@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    10 months ago

    Agreed. I’ve been trying to explain to someone recently why rebasing and force pushing their feature branch has no benefit when we use a squash commit strategy for merging to main.

    Again, tools are not blame, but when combined with a lack of understanding and accumulated “git dogma”, it can be quite disheartening.

    • dinckel@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      10 months ago

      I had a really sad eye-opener at university, in my third year. We had a lecture where they tried to explain what version control is, and the entire 300-something person class just said fuck it. These people honestly think that copying code to USB sticks and gDrive is easier than learning 4 commands, and a git frontend

    • AnActOfCreation@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      10 months ago

      I’ve been trying to explain to someone recently why rebasing and force pushing their feature branch has no benefit when we use a squash commit strategy for merging to main.

      While you’re 100% right, is there anything wrong with this approach? Sometimes I like to keep by personal branches clean, especially before I open a PR.

      • killeronthecorner@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        ·
        10 months ago

        It depends on your intent. If you’re doing it to keep history clean and linear in the long term, it’s a huge waste of time as it gets splatted into a single squashed merge commit. It also makes it difficult for reviewers to rereview your changes as GitHub/Lab can’t calculate the diff because you keep moving the goalposts with force pushes.

        If you’re doing it for cleanliness on your local branch then I guess that’s fine, but I find it anti-social in a multi participant repo.

    • TechNom (nobody)@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      10 months ago

      I had the fortune of being the trainer for my company in all things git. I made sure that my colleagues (most of whom were straight out of universities) were introduced to git CLI and git concepts. No git GUIs were introduced. Consequently, the mess they made was easy to rectify. And then I occasionally read about horror stories like these where GUIs are allowed.