Why Squashing Commits Is Powerful Yet Dangerous

Be careful and aware of your squashing action

Marcus Bentele
CodeX

--

A lightning symbolizes power and danger of squashing commits
Photo by Niilo Isotalo on Unsplash

Clean and understandable commit and change histories are a beauty themselves. There are no confusing branches, not a bunch of marginal typo-fixing commits, nor multiple work-in-progress commits “just to save it to be safe”.

The dream of every programmer, isn’t it?

The perfect addition would be meaningful commit messages. Those would ensure the opportunity of fellow programmers to follow made difference to the project’s state to continue working with the necessary code understanding.

But how are these clean commit histories achievable?

Branching, Rebasing, and Squashing

The process of ensuring a clean commit history and therefore a readable change history consists of three parts: Branching, rebasing and squashing. Let me quickly show you how to proceed.

Branching

--

--

Marcus Bentele
CodeX
Writer for

I spread knowledge about Data Science, Machine Learning, AI, and give general programming advice. Join Medium: https://medium.com/@marcus.bentele/membership