【发布时间】:2011-07-02 07:55:18
【问题描述】:
我的 post commit 钩子在 git 之后没有运行。如果我只是从终端运行它,我已经验证了该钩子确实有效。钩子里的代码是:
#!/bin/sh
#.git/hooks/post-commit
# An example hook script that is called after a successful
# commit is made.
#
# To enable this hook, rename this file to "post-commit".
perl -pi -e 's/([a-f0-9]+)$/'$( git rev-parse HEAD )/ ../../config/commit.git
我确实在 ./.git/hooks/ 中将文件重命名为 post-commit,权限为 -rwxr-x-r-x,所以我不确定它为什么不起作用。
【问题讨论】:
标签: git bash github post-commit githooks