squash commit into one code example Example 1: squash 3 commit $ git rebase -i HEAD~3 Example 2: squash commits in git git reset --soft HEAD~3 && git commit