Squashing commit during a merge
suggest changegit 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
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents