git squash multiple commits without using merge --squash code example Example: git squash last 2 commits git rebase -i HEAD~2