• pivot_root@lemmy.world
    link
    fedilink
    arrow-up
    19
    ·
    10 hours ago

    Solution:

    git commit --amend
    git push --force
    

    Problem:

    The process of discovering best practices on how to keep a clean git history is a goddamned challenge.

      • pivot_root@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        10 hours ago

        I didn’t want to make it sound too scary 😉

        Seriously, though, git really needs an option to treat --force as --force-with-lease. In the exceedingly rare occasion where I might want to completely overwrite a branch, it should be extra explicit by having to type something like --force-and-overwrite.

        • Ephera@lemmy.ml
          link
          fedilink
          English
          arrow-up
          2
          ·
          4 hours ago

          Yeah, I virtually only use --force for moving tags around (which one could definitely argue isn’t really a thing you should be doing regularly either)…