# Create Orphan Branch
git checkout --orphan temp_branch
# Add Files to Branch and commit
git add -A
git commit -am "the first commit"
# Delete master Branch
git branch -D main
# Rename temp/Current Branch to master
git branch -m main
# Push Changes to repo as master
git push -f origin main
Original post: How to Delete Commit History in Github