Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 2.17 KB

README.md

File metadata and controls

31 lines (24 loc) · 2.17 KB

MIT Licence Build Status GitHub version Github all downloads

Client Git Hooks

A set of useful and generic client side (local) git hooks. To add all of them to your project simply copy the git-hooks directory into the root of your project and then notify Git that this directory is to be used for its hooks. You can do this using the following command;

git config core.hooksPath git-hooks/

The above will only work if you are using Git 2.9 or greater. Otherwise you will need to either, copy the contents of the git-hooks directory in this project into the .git/hooks directory, or replace the .git/hooks directory with a symlink to the new directory.

Hook Functions Performed

  • exclude-strings - prevent commits including changes with specified strings.
  • file-size - prevent commits including files above a specified size.
  • message-format - prevent commit messages that do not match a specified pattern.
  • verify-author - prevents commits from users without author details set correctly.

Custom Configuration

The behaviour of these hooks can be changed by specifying custom git configuration. Each function performed by this library of standardized hooks has custom git configuration that can be added. To view more details of the configuration available for each hook, click the name of the hook in the previous list to be taken to the documentation.