Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

A Useful Template for Commit Messages

DZone's Guide to

A Useful Template for Commit Messages

A useful heuristic for writing better commit messages to effectively communicate code changes within your team.

· DevOps Zone
Free Resource

In response to accelerated release cycles, a new set of testing capabilities is now required to deliver quality at speed. This is why there is a shake-up in the testing tools landscape—and a new leader has emerged in the just released Gartner Magic Quadrant for Software Test Automation.

Here's a useful heuristic for writing better commit messages. Set your commit message template to:

# If applied, this commit will...

# Explain why this change is being made

# Provide links to any relevant tickets, articles or other resources

and you'll be guided into writing concise commit subjects in the imperative mood - a good practice. See rule 5 of Chris Beam's "How to write a commit message" for the inspiration of this tip and more reasoning on the use of the imperative mood.

To do this in Git, save the above content in a file (eg ~/.git_commit_msg.txt) and run:

$ git config --global commit.template ~/.git_commit_msg.txt

Here's what this looks like in practice:

/static/images/git-commit-snap.png

Try it - it's genuinely useful.

Recently published Gartner Magic Quadrant Report for Software Test Automation provides an objective benchmark of all test automation solutions based on industry surveys, customer inquiries, product evaluations, and more. 

Topics:
git ,commit ,template

Published at DZone with permission of David Winterbottom, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}