Git post-接收钩子没有执行

Git post-receive hook is not executed

以下post-receive挂钩:

#!/bin/bash
echo "-> Post-receive test"

推送到我的远程存储库时未执行

遥控器是 ssh://user@server:2222/home/git/repo.git(它是一个 VM)并且可以工作,因为当我手动检查它时,我看到了我所做的修改。

一些附加信息...

$ ls -al /home/git
drwxr-xr-x  7 git  git  4096 juin  15 15:40 repo.git

$ ls -al /home/git/repo.git/hooks
-rwxr-xr-x  1 git  git  117  juin  15 15:40 post-reveive

一切似乎都已到位,但是,当我推送到远程时,没有执行 post-receive 的痕迹:

Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 301 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
To ssh://user@server:2222/home/git/repo.git
   6c385f4..d368bf9  master -> master

为什么 post-receive 钩子不被执行?

挂钩文件的命名不正确 post-reveive