you are viewing a single comment's thread
view the rest of the comments
[–] 44 points 4 months ago (2 children)
rm -rf *

git add -A
git commit -m "oops."

rm -rf .git
git init
git add .
git commit -m "bye."

git push origin main --force
  • source
  • hideshow 4 child comments
  • [–] 51 points 4 months ago (1 child)

    rm-ing .git isn't gonna work cuz you'll have to re-add the remotes.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 10 points 4 months ago (1 child)

    Oh good point 🤦

    So maybe instead, we can clear all local + remote branches and tags, create a blank branch, delete main, rename the blank branch to main, then delete .git

    Although the OP says that we can merge anything, and we might not have access to mess with branches

  • source
  • parent
  • hideshow 2 child comments