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 →