I am working in Eclipse Mars (4.5.2) with EGit (4.1.1) on Windows8. I try to launch a pre-commit hook from within eclipse using GitForWindows.
I started the pre-commit file with: #!/bin/sh
and gave the PATH
Variable GITFORWINDOWS with the path to the bin folder in which the sh.exe of my GitForWindows installation is stored (C:\Program Files\Git\bin).
If I do git commit
in the GitBash, pre-commit is executed correctly, thus an error is thrown if a certain string is detected in the staged files. If I commit in Eclipse nothing happens. What am I doing wrong?
EDIT
I tried it with Cygwin as well. While it is working from the cygwin terminal (as well as from the GitInWindows terminal) it is not working from within eclipse.
I set the PATH
to C:\cygwin64\bin
where the sh.exe
is.
Can line returns be a problem? I have LF so far.