git 跟踪一个文件的更改
我们有一个很大的仓库和很多提交者。
我想跟踪单个文件的历史记录。 每当有人更改它(将更改推送到我的中央存储库)时,我都会收到包含差异和作者姓名的电子邮件。
我知道制作预提交挂钩可以解决我的问题,但是我必须将脚本传播给所有提交者。
是否有合并前(或合并后)挂钩?
临时解决方案是使用 cron 任务每 10 分钟检查一次谁更改了文件。
We have a large repo and a lots of commiters.
I want to track history of a single file.
Whenever someone changes it (push changes to my central repository), I get the email with diff and author name.
I know that making a pre-commit hook, to do so would resolve a problem for me, however I would have to propagate the script to all commiters.
Is there a pre-merge (or post-merge) hook?
Temporary solution would be a cron task checking every 10 min, who changes the file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,有一个
post-merge
挂钩。但是,根据您的描述,您可能希望在“中央”存储库上使用post-receive
挂钩。 Pro-Git hooks 页面对此进行了很好的描述。Yes, there is a
post-merge
hook. Based on your description, however, you probably want to use thepost-receive
hook on your "central" repository. The Pro-Git hooks page describes it quite well.