Skip to content

Instantly share code, notes, and snippets.

@hawkeyetwolf
Created December 22, 2015 16:26
Show Gist options
  • Save hawkeyetwolf/70e3e816e66c05e98935 to your computer and use it in GitHub Desktop.
Save hawkeyetwolf/70e3e816e66c05e98935 to your computer and use it in GitHub Desktop.
Install useful git pre-commit hooks
<?php
echo "Creating hooks directory.\n";
mkdir('.git/hooks', 0775, true);
echo "Downloading pre-commit hook.\n";
$fp = fopen('.git/hooks/pre-commit', 'w');
$precommit = file_get_contents('http://gitscripts.s3.amazonaws.com/pre-commit');
fwrite($fp, $precommit);
fclose($fp);
chmod('.git/hooks/pre-commit', 0775);
echo "Done.\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment