Squashing your commits

When you're developing on your machine, chances are that you commit often and every time you commit, your commit message might become a little less explanatory. Commits such as "Just testing" or "lets see if this works" are common in this phase, which does not make for a nice-looking timeline. Squashing commits makes sure that you have a nice explanatory commit message and that you only have the relevant commits in the Git history.

Before you push all these commits upstream to your GitLab server, you might want to reorder these commits and pack them together in one commit that has a nice commit message and a great explanation of what you've done.

How to do it…

In the following steps, we will squash some commits and push them ...

Get GitLab Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.