Git hooks are now bundled with the claroline distribution. For installation instructions, see claroline/Distribution#739 (comment).
pre-commit : One pre-commit to rule them all. pre-commit-phpcs : Run PHP_CodeSniffer on all your PHP files to be commited. (Depends on php-cs-fixer) pre-commit-jshint : Run JSHint on all your JavaScript files to be commited. (Depends on jshint) pre-commit-image-optimize : Run pngcrush and jpegtran on your PNG files and JPG files to be commited. (Depends on pngcrush and jpegtran) pre-commit-phpunit : Run PHPUnit. (Depends on PHPUnit)
Instructions are for installing on an Ubuntu/Debian based system.
sudo curl http://get.sensiolabs.org/php-cs-fixer.phar -o php-cs-fixer
sudo chmod a+x php-cs-fixer
sudo mv php-cs-fixer /usr/local/bin/php-cs-fixer
sudo apt-get install nodejs
sudo npm install -g jshint
sudo apt-get install pngcrush
sudo apt-get install libjpeg-progs
wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
sudo mv phpunit.phar /usr/local/bin/phpunit
RTFM : Installing git hooks
The hooks are all stored in the hooks subdirectory of the Git directory. In most projects, that’s .git/hooks, so basicly copy all the needed hooks into your .git/hooks directory and make sure they are executable.