- Do a temporary checkout
git checkout --orphan temp
- Commit the changes
git commit -am "cleaning"
- Delete the branch
git branch -D main
- Rename the current branch to main
git branch -m main
- Finally, force update your repository
git push -f origin main