Delete all commit history in github


Delete all commit history in a github project, e.g. on a github pages website project, only show the latest commit version, remove the commit history.

1. git clone https://github.com/username/project_name
2. git checkout --orphan latest_branch
3. git add -A
4. git commit -am "commit message"
5. git branch -D master
6. git branch -m master
7. git push -f origin master

ref. https://stackoverflow.com/questions/13716658/how-to-delete-all-commit-history-in-github


 Toc