简体   繁体   中英

git hook not running in Mac Monterey

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM