PHP code example of cheppers / git-hooks
1. Go to this page and download the library: Download cheppers/git-hooks library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
cheppers / git-hooks example snippets
/**
* Git hook tasks have to be started with 'githook' prefix.
* So the method name format is: githook<GitHookNameInCamelCaseFormat>
* Or use the @command annotation.
*/
class RoboFile extends \Robo\Tasks
{
/**
* Demo pre-commit callback.
*
* @command githook:pre-commit
*/
public function githookPreCommit()
{
$this->say('The Git pre-commit hook is running');
}
}