Squashing commit during a merge

suggest change

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

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents