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?

20 s
20

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

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

Leave a Comment