Member-only story
How to Take Your Git Commit Messages to The Next Level With a Commit Template

Whether you’re working on a solo project or part of a development team, you will have had multiple commit messages that don’t always make sense. Whether it’s the infamous “WIP” or a vague description that doesn’t encapsulate the whole story, we’re all guilty of this.
Allow me to share what has worked for me and what I’ve introduced to my development team for our daily git commits. With some planning beforehand, this will show you how to set up a git commit template for cleaner and concise messages.
Overview
Having a commit template embedded into your workflow not only allows for more detailed and precise commit messages but it also sets a standard for teams to follow.
I’ll break down the steps needed into segments.
- How to create a template file that git can use.
- How to set up a custom template on your machine.
- How to actually use it.
Creating a Template
Is your pet peeve receiving a pull request with an enormous amount of files changed and non-descriptive commit messages? Yeah, mine too. I know I’m not alone on this one so let’s begin by creating our template to help prevent this.
We will be loosely following Conventional Commits so if you are unfamiliar with this, I strongly suggest you give them a click.
First start off by creating a .txt file and naming it something precise like commitTemplate.txt for example. Place this file somewhere within your folder structure where you can easily access it. I placed mine in my development folder where my repo’s are cloned.