We will configure our newly created template, and then we will make a commit that will utilize the template.
To configure the template, we need to use git config commit.template <pathtofile> to set it, and, as soon as it is set, we can try to create a commit and see how it works:
- Start by configuring the template as follows:
$ git config commit.template ~/committemplate
- Now list the config file to see that it has been set:
$ git config --list | grep template commit.template=/Users/JohnDoe/committemplate
- As we predicted, the configuration was a success. The template, just like any other configuration, can be set at a global level using git config --global, or it can be set at a local repository level by leaving out the ...