I think the easiest way to do this is by making a new branch off ofbased on master and doing a merge --squashmerge --squash
of the feature branch.
git checkout master
git checkout -b feature_branch_squashed
git merge --squash feature_branch
Then you have all of the changes ready to commit.