1

So I have two windows machines, I'm basically trying to manage some web files with git I have a bare repository on the remote machine, I have a cloned version on the local machine and I have pushed some files to the remote repository.

I want the files to be deployed to the directory c:\UniServer\www\Scripts on the post-receive event here is the contents of my post-receive file:

#!/bin/sh
GIT_WORK_TREE=/c/UniServer/www/Scripts git checkout -f

My repo is stored in c:\repos\scripts.git\ I have set the permissions to c:\repos\scripts.git\hooks\post-receive to +x using chmod and I am using gitstack (http://gitstack.com) to admin the repository.

The problem is the files are not updating on the remote server when I push up a commit locally, is there a way to log what happens in the hook or simply make it work :)

update: the apache server has this error: [Sat Feb 02 20:04:53 2013] [error] [client xx.xx.xxx.xxx] error: cannot spawn hooks/post-receive: No such file or directory. C:\repos\scripts.git\hooks\post-receive does exist which makes me think this is a permissions error

Dan Nissenbaum
  • 13,558
  • 21
  • 105
  • 181
arcanine
  • 1,933
  • 1
  • 15
  • 22
  • I've tried chmod 777 post-receive but that hasn't worked I'm invoking bash by going to C:\GitStack\git and running git-bash.bat via admin – arcanine Feb 02 '13 at 12:20

1 Answers1

1

I had a the same issue and what resolved the problem for me was getting the GitStack service to run as a local user account rather than Local system. Whichever account you use will need read/write permissions to the repository folder of course, but I'm not sure what other permissions it may need; I just used a local admin account for testing purposes.

hope that helps!