邮政commit钩子没有运行 [英] Post Commit Hook Not Running

查看:160
本文介绍了邮政commit钩子没有运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的后commit钩子的git后没有运行。我已经验证了,如果我只是从终端运行的挂钩确实工作。在钩code是:

My post commit hook is not running after git. I have verified that the hook does work if I just run it from the terminal. The code in the hook is:

#!/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/后提交和权限 -rwxr-XRX 所以我不知道为什么它不将不起作用。

I did rename the file to post-commit in ./.git/hooks/ and the permissions are -rwxr-x-r-x so I am not sure why it doesn't work.

推荐答案

尝试前,​​把一些回声线像这样的Perl行之后:

Try putting some echo lines before and after the perl line like this:

echo "post-commit started"
perl ...........
echo "post-commit finished"

这样,如果脚本实际运行可以确认,因为当你运行

This way you can confirm if the script is actually running, because when you run

git commit

您应该看到

post-commit started
post-commit finished

对你输出的末尾。

Towards the end of your output.

这篇关于邮政commit钩子没有运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆