Last Updated: February 25, 2016
·
676
· hobnob

Squashing all commits into one

While trying to solve this problem, I cam across this little gem:
https://fundevnotes.wordpress.com/2013/02/17/squash-all-commits-into-one-commit-in-git/

The nicest of the three solutions provided here (in my opinion, at least) is this:

git update-ref -d refs/heads/master
git commit -m "New initial commit"