If you’ve ever made a lot of commits locally and wish there was a way to smash them all down into a single commit, you’re in luck. Git calls this concept “squashing commits.” I discovered the concept while working on documentation. It took me over a dozen commits to finally get a bit of markdown just right. The repo maintainer didn’t want to see all my attempts cluttering up the project’s history, so I was told to “just git squash your commits.”Squashing sounded like a solid plan. There was just one issue. I didn’t know how to do it.
Source: LXer – Learn Git: 3 commands to level up your skill