Is there a way to squash a number of commits non-interactively? November 29, 2022 by Tarik Make sure your working tree is clean, then git reset --soft HEAD~3 git commit -m 'new commit message'