• Valmond@lemmy.mindoki.com
    link
    fedilink
    arrow-up
    9
    ·
    8 months ago

    Why does

    git rebase

    work sometimes?

    Yeah git can get quite complicated when there ate lots of people working on the same things.

    • mkwt@lemmy.world
      link
      fedilink
      arrow-up
      17
      ·
      8 months ago

      It’s not git that’s complicated. The work is complicated. git is just one of the tools that programmers use to manage the complexity.

      I also think that some people get too hung up on having a “clean” history, and trying to “fix” the history after it has already occurred. I usually have enough problems to worry about in the present, without also trying to worry about the past.

      • Wrench@lemmy.world
        link
        fedilink
        arrow-up
        7
        ·
        8 months ago

        I find the “clean history” argument so flawed.

        Sure, if you’re they type to micro commit, you can squash your branch and clean it up before merging. We don’t need a dozen “fixed tests” commits for context.

        But in practice, I have seen multiple teams with the policy of squash merging every branch with 0 exceptions. Even going so far as squash merging development branches to master, which then lumps 20 different changes into a single commit. Sure, you can always be a git archeologist, check out specific revisions, see the original commits, and dig down the history over and over, to get the original context of the specific change you’re looking into. But that’s way fucking more overhead than just looking at an unmanipulated history and seeing the parallel work going on, and get a clue on context at a glance at the network graph.

        • GissaMittJobb@lemmy.ml
          link
          fedilink
          arrow-up
          3
          ·
          8 months ago

          Using curated commits to optimize for pull request reviewability is highly underrated. Liberal use of interactive rebasing to ‘tell a story’, essentially.

        • andioop@programming.dev
          link
          fedilink
          English
          arrow-up
          2
          ·
          8 months ago

          you’re they type to micro commit

          Thanks for a much shorter and better way to explain this tendency of mine and why I rebase a lot, yoinking this phrase.

      • zqwzzle@lemmy.ca
        link
        fedilink
        English
        arrow-up
        5
        ·
        8 months ago

        I like to rebase on my feature branches before the PR because it’s a gift to my future self that resolves all the conflicts (if any) before my work goes in. I just find trying to figure out how those conflicts got resolved when there are a bunch of merges in more difficult if there’s a problem later. It’s easier to understand for me. YMMV, this does not work for everyone. Etc etc.