Last active
August 29, 2015 14:16
-
-
Save standa/5eb23f5c2e2d69b9e6d6 to your computer and use it in GitHub Desktop.
Git post-commit php email hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
// Upload as .git/hooks/post-commit | |
mail( | |
'standa@example.com',. | |
implode(' ', array('[GIT]', trim(`hostname`), ' ', trim(`git log -n 1 --oneline`))), | |
`git log -n 1`, | |
implode(' ', array('From:', trim(`hostname`), 'git <standa@example.com>')) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment