git commit 后发送邮件而不是推送
我需要在提交到存储库后发送带有 diff 的电子邮件。我知道如何在推送后发送电子邮件,但它不适用于提交。
对于推送,我创建了获取参数的钩子 post-receive 。但是提交后的钩子没有收到任何参数,因此我无法使用发送邮件的脚本。
也许有一种方法可以在提交后挂钩中获取有关 newrev 和 refname 的信息,或者有其他方法可以在提交后发送邮件?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案很简单=)我通过使用以下行创建提交后挂钩解决了我的问题:
The answer is simple =) I've solved my issue by creating post-commit hook with this line: