I’m thinking on writing some tutorial on de-sloppifying some open-source projects, with I’m likely ending up at least starting some of them.

    • expr@programming.dev
      link
      fedilink
      arrow-up
      5
      ·
      24 days ago

      There’s no sense in deleting a project’s history before the fork, which is what that would do.

      It’s really quite simple:

      git reset --hard <some-commit-hash>. This will set HEAD to that commit, along with the contents of the working directory. You are the free to push to whichever git forge you are hosting on.

        • expr@programming.dev
          link
          fedilink
          arrow-up
          2
          ·
          24 days ago

          Sure that works too, though you would likely need to configure your git forge to treat that new branch as the master branch. A branch is ultimately just a pointer to a particular commit, though usually git forges treat one particular branch as “special” (it’s the default branch used for clones, and typically disallows direct pushes). This is usually the master or main branch. So my git reset suggestion was intended to reset whatever the default branch of the upstream repo was (probably master).