Git commit templates

One of neural2d’s contributors recently mentioned the advantages of using Git commit templates. It’s an easy way to make commit messages more consistent and useful. It’s such a good idea that I wanted to give it some exposure here.

The Git template places some text in the commit message dialog to help you remember how to format the commit messages consistently. It does not force you to format your commit messages in any particular way; it’s just a reminder. Instructions for setting up your own commit template can be found here.

Here’s the Git commit template that I’ll be using for neural2d:

# type(scope): Subject (<= 50 chars)

# body (description in imperative tone, <= 72-char width)

# footer

#------------------------------------------------|---------------------|------
#                                               50                    72
# type:
#   * feat (new feature)
#   * fix (bug fix)
#   * docs (changes to documentation)
#   * style (formatting, missing semi colons, etc; no code change)
#   * refactor (refactoring production code)
#   * test (adding missing tests, refactoring tests; no production code change)
#   * chore (updating grunt tasks etc; no production code change)

# scope can be, e.g.:
#   * doc
#   * gui
#   * build
#   * module-name

# footer:
#   * fixes
#   * closes
#   * resolves
#   * BREAKING CHANGE:

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Before you post, please demonstrate that you are a live, honest person:

How many degrees are in pi radians?