Home > Mobile >  git hook not running in Mac Monterey
git hook not running in Mac Monterey

Time:06-16

I have a pre-commit hook that is not running. I already tried with different shebangs:

#!/usr/bin/env zsh
# tried:
#/bin/zsh
#/bin/sh
#/usr/bin/bash
#/usr/bin/zsh
#/usr/bin/sh
#/usr/bin/env
#/usr/bin/env zsh
#/usr/bin/env bash
#/usr/bin/env sh

I tried giving it permission with

chmod ug x .git/hooks/*

The hook has no extension as requested. after I try git commit nothing happens other than the usual "files changed, etc" text

CodePudding user response:

So, It worked once I moved it to /.githooks folder instead of .git/hooks. The issue was that my core.hooksPath was pointing to /.githooks

  • Related