Skip to content

Git

Git Hooks Generator

Pick a hook type and the checks you want, get a working shell script with install instructions for raw hooks or Husky.

Hook type

Checks to include

#!/bin/sh
# pre-commit hook - generated with ArchSetu
# https://www.archsetu.com/tools/git-hooks-generator

# Run `npm run lint`
npm run lint || exit 1

exit 0

Install it

chmod +x .git/hooks/pre-commit
# then paste the script into .git/hooks/pre-commit (no file extension)

# Using Husky instead? Put the same script body in .husky/pre-commit