Send mail after git commit not push
I need to send email with diff after commit to the repository. I know how to send emails after push, but it is not working for commits开发者_运维问答.
For pushes I've created hook post-receive that gets parameters . But the hook post-commit does not recieve any parameters and because of that I can't use my script that sends mail.
Maybe there is a way to get info about newrev and refname in post-commit hook, or there is some other way to send mail after commit?
The answer is simple =) I've solved my issue by creating post-commit hook with this line:
git log -1 -p|mail -s "Git commit" mail@example.com
精彩评论