Post-尽管具有执行权限,但接收 githook 不会触发?
Post-receive githook does not trigger, despite having execution permissions?
我在这里看到了很多其他类似的问题,但其中绝大多数与权限有关。所以澄清一下:
- 我的文件恰好被称为“post-receive”
- 它没有扩展名
- 它位于 .git/hooks
- 以“#!/bin/bash”开头
- 有执行权限
运行 "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.
我在这里看到了很多其他类似的问题,但其中绝大多数与权限有关。所以澄清一下:
- 我的文件恰好被称为“post-receive”
- 它没有扩展名
- 它位于 .git/hooks
- 以“#!/bin/bash”开头
- 有执行权限
运行 "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.