• Omid Mnz@programming.dev
      link
      fedilink
      arrow-up
      6
      ·
      il y a 8 mois

      Prefer --force-with-lease. It doesn’t make a difference in this scenario, but it’s a safer habit/default.

      • xmunk@sh.itjust.works
        link
        fedilink
        arrow-up
        3
        ·
        il y a 8 mois

        There is no reason to force push anymore - force with lease is always preferable. So said, a frequent rebaser.

          • xmunk@sh.itjust.works
            link
            fedilink
            arrow-up
            11
            ·
            il y a 8 mois

            Force with lease will send up what your local thinks the most recent commit on the branch was and the host will reject the push if it knows of a more recent commit on that branch. Basically, it saves you from overwriting a commit you didn’t realize existed.