git hooks made easier. simple, lightweight, and portable.
like husky, but without npm.
curl -sSL https://githook.sh | sh
or with wget:
wget -qO- https://githook.sh | sh
this downloads .githook.sh to the current directory if not already, then runs install to setup hooks locally
curl -sSL https://githook.sh -o .githook.sh chmod +x .githook.sh ./.githook.sh install
./.githook.sh install set up git hooks (run once per clone) ./.githook.sh uninstall remove git hooks configuration ./.githook.sh check check for updates ./.githook.sh update download latest version
create executable scripts in .githook/ named after the git hook:
echo '#!/bin/sh npm test' > .githook/pre-commit chmod +x .githook/pre-commit
scripts must be executable and start with a shebang.
GITHOOK=0 skip hooks GITHOOK_DEBUG=1 show debug output
hooks are auto-migrated during setup if .husky/ is detected, or run manually:
./.githook.sh migrate husky
github.com/elee1766/githook.sh
unlicense (public domain)