I can't find any posts/articles on how to do this properly -- usually that means you're using it wrong, so I thought I'd ask here to check :)
I'm using Gitolite and it's working perfectly. I've implemented a common post-receive hook to be notified when one of my team members pushes a new commit, which I activated for their repos. The problem I'm having is, after each push (regardless of if the hook has changed or not) the file is overwritten with and gets the following permissions:
rwel@ve-git:~$ ls -la /home/git/.gitolite/hooks/common/
total 36
drwxr-xr-x 2 git git 4096 Jul 3 13:23 .
drwxr-xr-x 4 git git 4096 May 1 15:41 ..
-rw------- 1 git git 21002 Jul 3 13:23 post-receive
-rwxr-xr-x 1 git git 308 May 15 16:24 update
So, each time I do a gitolite-admin rwel$ git push origin
, I then have to logon to the git server and manually do sudo chmod a+x /home/git/.gitolite/hooks/common/post-receive
.
Is there a better way to do this?