Skip to content

Instantly share code, notes, and snippets.

@standa
Last active August 29, 2015 14:16
Show Gist options
  • Save standa/5eb23f5c2e2d69b9e6d6 to your computer and use it in GitHub Desktop.
Save standa/5eb23f5c2e2d69b9e6d6 to your computer and use it in GitHub Desktop.
Git post-commit php email hook
#!/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