Yeah learned this the hard way.

  • witness_me@lemmy.ml
    link
    fedilink
    arrow-up
    20
    ·
    18 hours ago

    I rebase and force push daily. I like squashing all my commits, and our main branch moves quickly so I rebase off that often. Zero issues for me.

    • smiletolerantly@awful.systems
      link
      fedilink
      arrow-up
      8
      ·
      18 hours ago

      Same. And even if you were to fuck up, have people never heard of the reflog…?

      Every job I’ve worked at it’s been the expectation to regularly rebase your feature branch on main, to squash your commits (and then force push, obv), and for most projects to do rebase-merges of PRs rather than creating merge commits. Even the, uh, less gifted developers never had an issue with this.

      I think people just hear the meme about git being hard somewhere and then use that as an excuse to never learn.

    • hayvan@feddit.nl
      link
      fedilink
      arrow-up
      2
      ·
      18 hours ago

      Yeah, I hate it when my repo is a chain of merge commits. I want to see actual changes to the code, not branch management history.

      • Mr. Satan@lemmy.zip
        link
        fedilink
        arrow-up
        2
        ·
        14 hours ago

        I’m the opposite. I just let git take care of the stupid content. Why mess with the commit graph? Merging locally (instead of squashing) works better with merge requests because the graph clearly shows what changes went where.

        I do some branch maintenance on my local branch (rebasing) until there are conflicts, but other than that I don’t see any benefit for messing with commit history.