Is there a way to squash a number of commits non-interactively?

Make sure your working tree is clean, then

git reset --soft HEAD~3
git commit -m 'new commit message'

Leave a Comment