Git on windows over HTTP. post-receive hook not working

1k views Asked by At

I have configured msysgit on Windows as a server over HTTP. I have configured Apache server to forward the requests to git-http-backened.exe. When I cloned and tried to push to the server from remote PC, everything worked perfectly. But the post-receive hook is not working.

I have added to post-receive

#!/bin/sh
echo "Hook got triggered.." > c:/Repos/logs.txt

When I manually execute the script, I see the log getting printed.

But when I push it from a remote system, files are getting updated. Push is working fine but the hook is not being invoked it seems, as the log is not printed.

Permissions for post-receive are -rwxr-xr-x

My post-receive used to send mails without any problem, when I configured git over SSH. After changing git to work over HTTP, I am facing issues. I have no clue, what extra changes need to be done to make the hook work.

1

There are 1 answers

4
VonC On

xxx.git/.git/hooks folder.

That wouldn't work: if the repo is a bare repo (as indicated by the naming convention xxx.git/, ie a folder ending with .git), then the hooks/ folder should be immediately below it.

xxx.git/hooks

And when you setup a Git server, the best practice remains for that server to manage only bare repos.
See: