I'd recommend checking out the rebase command for this. It does exactly what you are asking for
What this does is take smaller commits and combine them into larger ones
To use it:
git rebase -i HEAD~5
Your editor will pop up with the last 5 commits from the head of the current branch, with some documentation. In your case you will want to use squash
. The site I linked explains it really well, they have this example:
pick 01d1124 Adding license
squash 6340aaa Moving license into its own file
squash ebfd367 Jekyll has become self-aware.
squash 30e0ccb Changed the tagline in the binary, too.
This will package the previous 3 commits and put them all under the one you've marked as pick
. You can then modify the commit message and so forth.
Have fun