Deleting Commit History March 6, 2015 Change your directory to where you cloned the repository. git checkout --orphan latest_branch git add -A git commit -am "commit message" git branch -D main git branch -m main git push -f origin main git gc --aggressive --prune=all