I’ve done this countless times—interactive rebase is my go-to for squashing commits.
Run:
git rebase -i HEAD~N
(Replace N with the number of commits)
Change
pick
to squash (s)
for all but the first commit
Edit the commit message when prompted
Save & exit to complete the rebase
Boom! Clean history.