Squashing commit during a merge

suggest change

git merge --squash stages another branch’s changes on the branch you have checked out. It does not create a commit.

git merge --squash <branch>
git commit

The commands below do a different rewrite: they check out <branch> and replace every commit after the merge base with one new commit.

git checkout <branch>
git reset --soft $(git merge-base master <branch>)
git commit

Feedback about page:

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



Table Of Contents