To squash or not to squash: that is the question

Daniel Bunte
3 min readJun 26, 2019
Photo by James Pond on Unsplash

When I started my last project, I was the first developer on the team, which I would later be leading. While setting up infrastructure and version control, I adapted many things from previous projects. This is what you usually do with experiences — appreciate the good parts and leave behind what didn’t work.

Regarding the git version control, I decided to use squash commits, when a feature is merged into the master branch.

What is a squash commit, you ask? In simple words, it will combine all commits that were made on a feature branch so that you end up with one single commit message that reads something like “Merged feature/bake-cookies into master”. When you look up your master branch history, you will only see the “feature merges”, not the individual commits (there’s no “mix ingredients for cookie recipe”). You will end up with a “squashed” branch history.

Back then, I didn’t even notice I made this decision. It was a process without much thinking involved.

--

--

Daniel Bunte

Leader, self-taught developer with interests in Architecture/Automation/Security.