DEV Community

Josh Branchaud
Josh Branchaud

Posted on

Crafting Commits

The products we build as software developers are always evolving.

We have a codebase in motion.

The additions and deletions in the form of commits are what put our codebase in motion. The commits that a team is writing show where the codebase is headed. Past commits provide insight and evidence into how we got where we are.

As we craft commits, we ought to always have this dual objective in mind.

First, the commits we write need to communicate our intentions, the what and why of the changes. Pull requests made up of commits that do this well will make code reviews much more pleasant and help mitigate all kinds of conversations.

Second, the commits that we and the rest of the team have written tell a story about how the code got here. They provide a bread crumb trail that can be followed. The way we prepare our commits affects how we are later able to do code investigations and approach challenging debugging tasks.

To do this, we have to build atomic commits by squashing our cleanup commits and writing good commit messages that tell the why and link to supplemental content like the feature or bug ticket.

Craft your commits with both code reviews and code investigations in mind.

Top comments (0)