rudikershaw / client-git-hooks

A configurable library of useful client side (local) git hooks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

A configurable library of useful client side (local) git hooks

License:MIT License


Languages

Language:Shell 90.8%Language:Makefile 7.1%Language:Dockerfile 2.1%