LinkORB Engineering

Configure LinkORB's commit message template in [#git]

An effective commit message summarizes changes introduced in a commit. It ensures collaborators understand a change and the motivation for that change without digging through every minute detail.

To ensure team members write effective commit messages, the LinkORB Engineering team maintains a commit template which provides hints in a commit message editor. The following guide outlines how to configure and use LinkORB’s commit template when contributing to a Git repository.

Add a commit message template to a containerized repository

Most LinkORB Git repositories rely on repo-ansible for commit template configuration in development containers. However, if you’re setting up a development container that doesn’t depend on repo-ansible, you may add the master copy of LinkORB’s commit template to the container by adding the following to the repository’s Dockerfile:

RUN wget https://raw.githubusercontent.com/linkorb/.github/master/linkorb_commit.template && \
  git config --global commit.template linkorb_commit.template

Configure an existing commit message template for a non-containerized repository

Save the commit template to a linkorb_commit.template file at the root of the repository and run the below command:

git config --local commit.template linkorb_commit.template

Git will use the set commit message template the next time you run git commit from the command line or from the IDE’s source control tool.

When using VSCode, you may invoke the template after staging changes in the source control menu by clicking the Commit button (without filling out the message field) or by pressing Ctrl + Enter when the message field has focus.

The commit template configuration above does not apply to git commit operations run with the -m option (i.e. git commit -m "commit message example") or messages typed directly into the message field in VSCode’s source control pane.

Further reading

About Git