pre-commit 178 B

12345678
  1. branch="$(git rev-parse --abbrev-ref HEAD)"
  2. if [ "$branch" = "main" ]; then
  3. echo "You can't commit directly to main - please check out a branch."
  4. exit 1
  5. fi
  6. npx lint-staged