I use ssh to access a remote git repository. I add such a simple post-receive script in hooks directory:
#/bin/sh
REPO="$1"
REV="$2"
echo $REPO $REV >> /var/log/gitlog
I changed the code in local PC and push many times, and I saw nothing in /var/log/gitlog
. I have checked the permission of post-receive. Its file mask has been set to 777. All users can execute the script on the console.