In the case that you have hundreds or thousands of commits, using kostmo's answer of
git rebase -i --root can be impractical and slow, just due to the large number of commits that the rebase script has to process twice, once to generate the interactive rebase editor list (where you select what action to take for each commit), and once to actually execute the re-application of commits.
Here is an alternative solution that will avoid the time cost of generating the interactive rebase editor list by not using an interactive rebase in the first place. In this way, it's similar to Charles Bailey's solution. You simply create an orphan branch from the second commit, and then rebase all the descendant commits on top of it:
git checkout --orphan orphan <second-commit-sha> git commit -m "Enter a commit message for the new root commit" git rebase --onto orphan <second-commit-sha> master