Hello, I'm trying to add pre-commit git hook and deploy it on magento cloud project. I've tried to do this via composer json
"scripts": { "post-install-cmd": [ "git config core.hooksPath .githooks" ], "post-update-cmd": [ "git config core.hooksPath .githooks" ] }
And during building application on the cloud I've got an error
W: > git config core.hooksPath .githooks W: fatal: not in a git directory W: Script git config core.hooksPath .githooks handling the post-install-cmd event returned with error code 128
Seems like git repo is removed during deployment on magento cloud. Is it correct? How can I add that git hook in this case?
Thanks in advance.
The core.hooksPath support is new in Git version 2.9, having been put in with commit 867ad08a2610526edb5723804723d371136fc643.
If your Git version is not at least 2.9.0, setting a hooks-path variable will have no effect at all.
You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up.