How do I merge a large number of commits in phases of, say, 20 commits at a time?
Why would you want to do that? Mashing up the commits just gets rid of the history.
If you really do want to do this, I'd go for "git rebase -i" (interactive rebase), that alows you to go wild rewriting history (reordering commits, smashing them together, delete some, ...). Splitting commits can be done, but it is a bit tricky.
I'd go like:
git branch save # don't want to lose the original accidentally...
git rebase -i HEAD~20 # for last 20 commits
# Edit the offered template at will, minimal help included
# Exiting the editor makes git do as told, it might stop if manual intervention required