One of the most powerful features of git is that it gives you the ability to alter the commit history of your repository. This way I can have the best of both worlds by committing often during feature development, but then being able to consolidate all of the commits into a single “unit of work” when the feature is complete. In the case where no new commits have been made to the master branch, the feature branch can be combined into a single commit with:
git checkout master git merge feature-branch --squash