Quick fixes for common hook issues.
# Check if hook exists and is executable
ls -l .git/hooks/pre-commit
# Fix permissions
chmod +x .git/hooks/*Black/Ruff not found (Python):
pip install black ruff
# or
uv add --dev black ruffPrettier/ESLint not found (JavaScript):
pnpm add -D prettier eslintgofmt not found (Go):
# gofmt comes with Go, install Go first
brew install go # macOSPython:
# Auto-fix formatting
black .
ruff check --fix .
# Try commit again
git commit -m "your message"JavaScript:
# Auto-fix formatting
npx prettier --write .
npx eslint --fix .
# Try commit again
git commit -m "your message"Go:
# Auto-fix formatting
gofmt -w .
# Try commit again
git commit -m "your message"# 1. Remove the secret from staged files
git restore --staged <file>
# 2. Move secret to secrets.json (gitignored)
echo '{"api_key": "sk-ant-..."}' > secrets.json
# 3. Update code to load from secrets.json
# See AgentUsage/secrets_management.md
# 4. Stage and commit again
git add .
git commit -m "your message"False positive? Edit .git/hooks/pre-commit-secrets and add filename to WHITELIST_FILES array.
# Run tests locally to see failures
pytest tests/ # Python
pnpm test # JavaScript
go test ./... # Go
# Fix failing tests
# Then try push again
git push# Skip ALL hooks (use sparingly!)
git commit --no-verify -m "emergency fix"
git push --no-verify
# Remember to fix the issues later!pre-push taking too long:
# Run only fast tests
# Edit .git/hooks/pre-push and add:
pytest tests/ -m "not slow" # Mark slow tests with @pytest.mark.slow
pnpm test --testPathIgnorePatterns=e2e # Skip E2E tests# Manually update deps
uv sync # Python
pnpm install # JavaScript
go mod download # Go
# Check if hook exists
ls -l .git/hooks/post-checkout
# Reinstall hook
cp AgentUsage/pre_commit_hooks/post-checkout .git/hooks/
chmod +x .git/hooks/post-checkout# Backup first
mv .git/hooks .git/hooks.backup
# Create new hooks dir
mkdir .git/hooks
# Copy back samples
cp .git/hooks.backup/*.sample .git/hooks/ 2>/dev/null || true# Use installer (recommended)
./AgentUsage/pre_commit_hooks/install_hooks.sh
# Or manually
cp AgentUsage/pre_commit_hooks/commit-msg .git/hooks/
cp AgentUsage/pre_commit_hooks/pre-commit-python .git/hooks/pre-commit
cp AgentUsage/pre_commit_hooks/pre-commit-secrets-scanner .git/hooks/pre-commit-secrets
cp AgentUsage/pre_commit_hooks/pre-push .git/hooks/
chmod +x .git/hooks/*- Check
setup_guide.mdfor detailed installation steps - Check
examples.mdfor hook customization - Run hook manually to see full error:
.git/hooks/pre-commit - File an issue at https://github.com/AutumnsGrove/BaseProject/issues