• JoYo@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    Anyone mind explaining to me how git rebase is worth the effort?

    git merge has it’s own issues but I just don’t see any benefit to rebase over it.

    • Jesus_666@feddit.de
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      3 months ago

      I use interactive rebases to clean up the history of messy branches so they can be reviewed commit by commit, with each commit representing one logical unit or type of change.

      Mind you, getting those wrong is a quick way to making commits disappear into nothingness. Still useful if you’re careful. (Or you can just create a second temporary branch you can fall back onto of you need up your first once.)

      • bamboo@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        0
        ·
        3 months ago

        This 100%. I hate getting added to a PR for review with testing commits in the history, and I’m expected to clean those up before merging into main.

        • Zangoose@lemmy.one
          link
          fedilink
          arrow-up
          1
          ·
          3 months ago

          I feel like squash and merge on GitHub/GitLab is nicer for that anyway though, it makes the main branch so much cleaner automatically

    • Aux@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      Well, rebase allows you to resolve the same conflict ten times in a row instead of doing it once. How cool is that?