Git Hooks Library
Ready-to-use Git hook scripts. Pick a hook, configure it for your stack, and copy the script.
These hooks work great with Tower, a native Git Client for Mac and Windows. Tower makes managing branches, commits, and conflicts easy and fun!
Code Quality
β Enforce standards before code enters the repo-
Run Linter on Staged Files Lint only the files you're about to commit, not the entire project.pre-commit β
-
Check for Debug Statements Catch console.log, debugger, print(), and other debug leftovers.pre-commit β
-
Check for Merge Conflict Markers Prevents committing files with leftover <<<<<<< markers.pre-commit β
Commit Message Standards
β Standardize how your team writes commit messages-
Enforce Conventional Commits Validates the type(scope): description format.commit-msg β
-
Require Ticket Reference Ensures every commit references a Jira, GitHub, or Linear issue.commit-msg β
-
Auto-Prepend Branch Name Extracts the ticket ID from your branch and adds it to the message.prepare-commit-msg β
Security & Secrets
β Prevent credentials and sensitive data from entering the repoBranch & Workflow Protection
β Protect branches and enforce team workflow rules-
Prevent Commits to Protected Branches Blocks direct commits to main, master, or other protected branches.pre-commit β
-
Enforce Branch Naming Convention Validates branch names match your team's naming standard.pre-commit β
-
Enforce File Size Limit Blocks commits containing files over a configurable size threshold.pre-commit β