Skip to content

Check that git commit messages are formatted according to certain guidelines.

Notifications You must be signed in to change notification settings

mrkevinze/git-commit-msg-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git Commit Message Checker

The script checks that git commit messages are formatted according to certain guidelines documented in guidelines.txt.

The checker should catch common errors, but it cannot provide perfect validation.

Installation

  1. Give the commit-msg file permissions to execute, e.g. chmod u+x commit-msg
  2. Copy the commit-msg file into the .git/hooks folder of your git repository.
  3. The script will be executed by git locally when a git commit is performed.

The script is also known as a git hook.

Discussion

The advantage to running the script locally is that it is simple and errors can be caught before a commit is done. The downside is that the user may forget to install or update the script, or bypass it altogether.

The alternative is to install a server-side hook, so that the script runs when a push is done. If the check fails, the push will be rejected. To do this, rename the script to use an appropriate hook. Remember to handle different arguments specific to each different hook.

References

Git Hooks
Tutorial by Atlassian

About

Check that git commit messages are formatted according to certain guidelines.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages