Book Image

Git Version Control Cookbook

By : Aske Olsson, Rasmus Voss
Book Image

Git Version Control Cookbook

By: Aske Olsson, Rasmus Voss

Overview of this book

Table of Contents (19 chapters)
Git Version Control Cookbook
About the Authors
About the Reviewers

Setting up and using a commit template

In this chapter, we have been using dynamic templates, but Git also has the option of a static commit template, which essentially is just a text file configured as a template. Using the template is very easy and straightforward.

Getting ready

First of all, we need a template. This has to be a text file whose location you should know. Create a file with the following content:

#subject no more than 74 characters please

#BugFix id in the following formats
#artf [123456]
#PCP [AN12354365478]
#Bug: 123456
#Descriptive text about what you have done 
#Also why you have chosen to do in that way as 
#this will make it easier for reviewers and other

This is my take on a simple commit message template. You might find that there are other templates out there that prefer to have the bug in the title or at the bottom of the commit message. The reason for having this at the top is that people often tend not to read the important parts of the text! The...