This can be done easily without git rebase
or git merge --squash
. In this example, let's squash the last 2 commits.
git reset --soft HEAD~2
The 2
above points at the last 2 commit counting from the HEAD which is the top most commit in history
git commit