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?

1 Answer 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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.