Deleting Github History
I recently wanted to take a project from private to public, but I wasn’t real sure what was in the history. I think I committed a few sensitive keys during development. So, I looked up how to nuke your github history and ran across this stackoverflow post that I thought was invaluable. This is the answer that worked for me.
git checkout --orphan latest_branch
Add all the files
git add -A
Commit the changes
git commit -am "commit message"
Delete the branch
git branch -D master
Rename the current branch to master
git branch -m master
Finally, force update your repository
git push -f origin master