Skip to main content
4 of 4
Add Shell syntax highlighting
Benjamin Loison
  • 5.5k
  • 4
  • 18
  • 37

To squash the last 10 commits into 1 single commit:

git reset --soft HEAD~10 && git commit -m "squashed commit"

If you also want to update the remote branch with the squashed commit:

git push -f
Ayan
  • 8.6k
  • 4
  • 48
  • 52