You can use git merge --squash
to squash changes introduced by a branch into a single commit. No actual commit will be created.
git merge --squash <branch>
git commit
This is more or less equivalent to using git reset
, but is more convenient when changes being incorporated have a symbolic name. Compare:
git checkout <branch>
git reset --soft $(git merge-base master <branch>)
git commit