PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

Freek Lijten's Blog: Git commit hooks using PHP

Note: This article was originally published at PHPDeveloper on 7 July 2011.
PHPDeveloper

In this new post from Freek Lijten he looks at a set of git commit hooks written in PHP for making things happen before, during and post commit.

Git hooks are usually found inside the .git/hooks folder of your git repository. Git tends to provide sample hook files there which are postfixed with a .sample extension. These examples are written as shell scripts. Take a look at them if you want, but today we're talking PHP!

He briefly touches on the types of hooks you can set up and includes two example scripts showing a pre-commit lint test for the changed files and a check during the commit on the message given for a certain standard (in their case, it must start with a three letter code).