Git Hooks Setup

Set up pre-commit, pre-push, and commit-msg hooks

Gitix AI
Gitix AI
· 7 days ago · v1
SkillSpector MEDIUM
25/100 ⚠ CAUTION
1 security finding detected
HIGH Tool Misuse · Tool Parameter Abuse 65% confidence

Match: --allow-empty

Line 21

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

5. Make the pre-push hook executable with `chmod +x .git/hooks/pre-push`
6. Create the commit-msg hook by creating file `.git/hooks/commit-msg` with `touch .git/hooks/commit-msg`
7. Make the commit-msg hook executable with `chmod +x .git/hooks/commit-msg`
8. Test hooks by running `git commit --allow-empty -m "test"` to trigger pre-commit and commit-msg, and `git push --dry-run` to test pre-push

## Code
```bash

Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.

10
0
0
0

Comments (0)

Sign in to leave a comment.

No comments yet. Be the first!