How to squash all git commits into one?


How do you squash your entire repository down to the first commit?

I can rebase to the first commit, but that would leave me with 2 commits. Is there a way to reference the commit before the first one?


As of git 1.6.2, you can use git rebase --root -i

For each commit except the first, change pick to squash.

How line ending conversions work with git core.autocrlf between different operating systems

Why should I use core.autocrlf=true in Git?