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