1

I try to set up a first simple pre-commit hook on a project on windows but I don't manage to stop the commit using exit code. I use Gitkraken and it runs cygwin as shell.
The pre-commit file contains the following script:

#!/bin/sh
echo "OK THAT line works..." > test.log
exit 1

When commiting, it generates the log file but the commit is not blocked by the return code.
What am I doing wrong?

4

1 回答 1

1

Finally found by myself with a colleague. In case someone run into the problem. The Path to sh parameter for Gitkraken has to be set to cygwin but with the -i option:
C:\cygwin64\bin\mintty.exe -i

edit: or simpler with c:\cygwin64\bin\sh.exe

于 2017-07-18T16:03:25.720 回答