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.

you are viewing a single comment's thread
view the rest of the comments
[–] 5 points 3 weeks ago (1 child)

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.

  • source
  • parent
  • hideshow 1 child comment
  • [+] 1 point 3 weeks ago (1 child)
  • [–] 2 points 3 weeks 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).

  • source
  • parent
  • load more comments (-1 replies)