Skip to content

Setup a commit template

Antonio Ossa edited this page Feb 6, 2018 · 1 revision
  1. Place you template in a safe place and remember the path to your file. In this example, we'll use ~/.gitmessage.

  2. Specify the path to your template in your config file as commit.template using this command:

    $ git config commit.template PATH

    You can use the commit template in an relative path to your repository too. See this SO question.

  3. To use your template, just use the git commit command, and the template will be open in your default editor. Once you save and close the opened file, the commit is completed.

Clone this wiki locally