How can I git squash commits to combine my last N commits into a single commit?

I’ve done this countless times—interactive rebase is my go-to for squashing commits.

:small_blue_diamond: Run: git rebase -i HEAD~N (Replace N with the number of commits)

:small_blue_diamond: Change pick to squash (s) for all but the first commit

:small_blue_diamond: Edit the commit message when prompted

:small_blue_diamond: Save & exit to complete the rebase

Boom! Clean history. :white_check_mark: