In this example, we will see how to create a template commit message that will be displayed in the editor when creating a commit. The template is only for the local user and not distributed with the repository in general.
In this example, we will use the example repository from Chapter 1, Navigating Git:
$ git clone https://github.com/dvaske/data-model.git $ cd data-model
We'll use the following code as a commit message template for commit messages:
Short description of commit Longer explanation of the motivation for the change Fixes-Bug: Enter bug-id or delete line Implements-Requirement: Enter requirement-id or delete line
Save the commit message template in $HOME/.gitcommitmsg.txt
. The filename isn't fixed and you can choose a filename of your liking.