This project uses Githooks, that allows running Git hooks checked into this repository. This folder contains hooks that should be executed by everyone who interacts with this source repository. For a documentation on how this works and how to get it installed, check the project README in the rycus86/githooks GitHub repository.
The directories or files in this folder tell Git to execute certain scripts on various trigger events, before or after a commit, on every checkout, before a push for example - assuming Githooks is already installed and enabled for the repository. The directory or file names refer to these events, like
pre-push, etc. If they are folders, each file inside them is treated as a hook script (unless ignored), and will be executed when Git runs the hooks as part of the command issued by the user. Githooks comes with a command line helper tool, that allows you to manage its configuration and state with a
git hooks <cmd> command. See the documentation or run
git hooks help for more information and available options.
Is this safe?
How do I add a new hook script?
Either create a file with the Git hook name, or a directory (recommended) inside the
.githooks folder, and place files with the individual steps that should be executed for that event inside. If the file is executable, it will be invoked directly, otherwise it is assumed to be a Shell script - unless this file matches one of the ignore patterns in the
How can I see what hooks are active?
You can look at the
.githooks folder to see the local hooks in the repository, though if you have shared hook repositories defined, those will live under the
~/.githooks/shared folder. The command line helper tool can list out all of them for you with
git hooks list, and you can use it to accept, enable or disable new, changed or existing hooks.
If you find it useful, please show your support by starring the project in GitHub!