开发者

Send mail after git commit not push

开发者 https://www.devze.com 2023-01-17 11:03 出处:网络
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开发者_运维问答.

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
0

精彩评论

暂无评论...
验证码 换一张
取 消