Post-尽管具有执行权限,但接收 githook 不会触发?

Post-receive githook does not trigger, despite having execution permissions?

我在这里看到了很多其他类似的问题,但其中绝大多数与权限有关。所以澄清一下:

运行 "ls -l post-接收" returns:

-rwxr-xr-x

如果我通过 git bash 手动 运行 文件,它可以完美运行。但无论我推动什么,它都不会自动触发。这是怎么回事?

post-receive is a server side hook! You can store hooks in the repository but you have to have access to .git/hooks/ at the server. If the server is a Git hosting like Github/Gitlab then you cannot have server-side hooks but you can have webhooks.