![](/img/trans.png)
[英]Is it possible to save a git commit message to a file in a pre-commit hook?
[英]git: how to obtain the commit message of the file before it gets committed using pre-commit hook?
我正在处理一个钩子脚本,以获取当前正在提交的文件的提交消息,并更改提交消息,然后提交,如果它不满足模式。
我的问题是,有没有办法在提交之前获取文件的提交消息并更改提交消息然后提交文件?
pre-commit
钩子旨在检查提交的内容而不是提交消息。
您可能正在寻找prepare-commit-msg
挂钩或更可能是commit-msg
挂钩来更改提交消息。
以下是与提交操作相关的有序挂钩列表:
有关不同挂钩的更多信息,请参见githooks手册页 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.