Sometimes your commits at a branch reach a high number, "fixing the issue", "fixing security", and "covering with more test cases", and your changes become a little bit disorganized. In that case, squash commit can help you group changes and describe the commit.
I'm not a big fan of significant changes, I know that occurs more than expected.
Okay, my discovering and describing tasks failed.

Stopping talking about regrets and thoughts. Let's do a quick sample.
Firstly, time to create the master branch and make the first commit.

Let's create another branch to make some changes, "I wrote some bugs, nothing new."

Okay, now time to make more changes, "Sorry, I forgot to create tests. 😅"

Oh no! I broke the test, wrong grep. "If tests work, time to create pull request."

Ouch, so many commits! I need to squash commits and push them to the task branch.

vi (useful)
i – Insert at cursor (goes into insert mode)
ESC – Terminate insert mode
dd – Delete line
3dd – Delete 3 lines.
x – Delete character at the cursor
ESC and :x -> save
ESC and :q! > quit without save
As you can see, the first commit keep as "pick" and others as "squash."

Close editor and save commit ESC and :x.

Create your pull-request
That kind of story might happen in your developer day, so I hope I can help you to update your kernel bye!