Learn how to automatically squash commits on GitHub when merging pull requests. You can make this automatic in your repo's settings on GitHub or by clicking it in the dropdown menu when you go to merge a PR.
If you prefer to learn by reading, you can read the accompanying blog post.