Git: Better commit messages

2015-10-13

To push yourself to write better commit messages, consider defining a better starting template.

Place the following text into a .git-message.txt file in your home directory:

1
2
3
# If applied, this commit will...
# Explain why this change is being made
# Provide links to any relevant tickets, articles or other resources

Then do
git config commit.template $HOME/.git-message.txt

Now when you do a commit, the above comments will appear and remind you of the important parts of a commit message.

Obviously adjust it according to your project’s standards and requirements.


Comments: