Published on

Squashing commits with git reset

Authors
  • Name
    Twitter

Squashing commits with git reset

Squash commits without using git rebase

  1. Squashing the commits
git reset --soft HEAD~<number_of_commits>

or

git reset --soft <commits ID>
  1. Commit the changes
git commit -m “my new merged commit”
  1. Push to remote branch
git push origin branch --force-with-lease