I am trying to get a git post-receive hook running on windows.
I am using git 1.7.9 (Msysgit) and have a repo locally and a bare repo on a remote server. I can receive, commit, click, etc. I set the hook after the reception, which should check the files in the working folder (part of the deployment process), but it does not work.
That's what I'm doing:
- Modify the file, complete the step, and execute it.
- Click on a remote server - successfully
- Expect to see an echo - don't see an echo
- Check the working folder on the server - the latest files are missing.
- Go to the server and run the hook script manually - the latest files exit the working folder.
I changed the hook, so it does nothing but echo the message, and I read that I should see this in my console after clicking. But this is not displayed, so I can only assume that the hook does not start.
I am pushing HTTP using git dot aspx on the server, processing the request and pasting through gui locally. After that I tried Bonobo, and the hook does not work when pressed through gui or bash console.
I assume that this works for someone somewhere, but after two days of searching, all I found are solutions that do not help, or people with the same problem that went unanswered.
(I'm a git newbtw btw).
Greetings.
Update
I'm starting to think that this may be related to permissions - but Unix permissions, not NTFS. When @eis mentioned permissions, I suggested NTFS. But after even more digging, it seems that git on Windows still checks for Unix perms files.
Therefore, I suspect that the problem is that the file after receiving is not executable, as when I do ls -o it -rw-rr-- (in my opinion, 644). If I try to change this via bash and chmod 777 post-receive , then do ls -o , the permissions will be the same.
It is strange that as soon as I edited post-receive (using notepad ++), the execution bit will be deleted. (my test script, which ends with .bat, retains its execution bits, though ...)
BTW, the user I'm registered with is the owner of the files (according to ls -o ), and yet I cannot set permissions.
It starts to really get confused. Am I missing something really obvious?
Update 2
Neither chmod 777 post-receive nor chmod a+x post-receive work. I took a new, clean post-receive file, uploaded it to the server and checked the permissions and executed it. If I rename the file (to remove the sample) on Windows, then the execution will be deleted. If I do this in bash with mv , the execution will be saved. But, whenever I edit the file (on Windows or in bash with vi), then the execution is deleted.
So now the problem is why does it delete the executable bits when editing the file?
I hope this is the last obstacle and the reason for its non-compliance ...