Skip to content

Instantly share code, notes, and snippets.

@kota65535
Created January 18, 2023 18:47
Show Gist options
  • Save kota65535/94bf7ffbc2d8a660c8e5abf625fa23d1 to your computer and use it in GitHub Desktop.
Save kota65535/94bf7ffbc2d8a660c8e5abf625fa23d1 to your computer and use it in GitHub Desktop.
Self-install pre-commit hook script
#!/usr/bin/env bash
set -euo pipefail
# Install pre-commit hook
if [[ $0 != ".git/hooks/pre-commit" ]]; then
cp "$0" .git/hooks/pre-commit
fi
# Do something ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment