Skip to content

Latest commit

 

History

History
executable file
·
42 lines (33 loc) · 1.52 KB

git-hooks.md

File metadata and controls

executable file
·
42 lines (33 loc) · 1.52 KB

Using Git hooks

Using Composer hooks User guide Using Docker

The toolkit allows you to hook into git events. This is useful for example if you want to apply standards to commit messages or need to perform coding standards before pushing your code.

How it works

The toolkit provides two targets with which you can control the status of your git hook scripts.

1. git-hook-enable

The execution of this target can be automatically triggered after toolkit installation. The target will look for scripts in a folder inside of resources/git/hooks that is named with the name of the git hook you wish to use.

If any scripts are found in these locations the toolkit will simlink the scripts into .git/hooks location with the chosen hook name. If no scripts are found in the folder it will remove any previous execution script. Here is an example of a script being placed in the resources/git/hooks/pre-push folder:

resources/
├── composer.json
├── composer.lock
├── devel.make
├── git
│   └── hooks
│       └── pre-push
│       └── prepare-commit-msg
└── site.make

Note: the script itself should be made executable to work.

2. git-hook-disable

This target will disable the execution scripts so no more git hooks will be invoked.