This is an old question, but I've been fighting with this exact problem and this SO question popped up, so I thought it worth the effort to record what worked for me.
In short: I needed to run Apache
as a regular user instead of Local System
. This was on a legacy test VM
I was playing with, so it was only running Windows XP
, but it appears that at least on that platform (and possibly others), msysgit
just doesn't work properly when running under the Local System
account (presumably the root filesystem
isn't mapped properly). As a result, no shebang line will work as git-http-backend simply can't execute any msysgit binaries (even with absolute Windows
paths).
Switching Apache to run as a regular user account fixed this problem completely. Obviously you need to ensure that the user Apache is running as has permissions to read
/write
the git
repositories, but beyond that, just make sure your shebang
line is #!/bin/sh
and everything should be copacetic.
Lastly, yeah, this is a big hammer. Ideally you'd be able to use something like suexec
on Windows
, but a quick googling
doesn't indicate an obvious path forward, there. Of course, if anyone has any ideas, I'd be interested.
For now, this works for me, but it doesn't seem ideal.