Skip to main content
Termpad supports running git hooks automatically during git operations. This includes both standard git hooks and Husky-managed hooks.

Supported Hook Types

How Hooks Work

Blocking Hooks

Hooks like pre-commit, commit-msg, and pre-push will prevent the operation from completing if they fail:
  • pre-commit: Runs before creating the commit. If it fails, the commit is not created.
  • commit-msg: Validates the commit message. If it fails, the commit is not created.
  • pre-push: Runs before pushing to remote. If it fails, the push is cancelled.

Non-Blocking Hooks

Hooks like post-commit and post-push run after the operation completes:
  • post-commit: Runs after the commit is created. If it fails, an error is shown but the commit remains.
  • post-push: Runs after the push succeeds. If it fails, an error is shown but the push is already complete.

Husky Support

Termpad supports Husky v9+ directory structure:
  • Works with .husky/ directory
  • Automatically detects and runs Husky hooks
  • No additional configuration needed
If you’re using Husky, make sure it’s installed and configured in your repository. Termpad will automatically detect and run your Husky hooks.

Common Use Cases

Code Formatting

Run formatters like Prettier or Black before commits:

Linting

Check code quality before commits:

Lint Staged Files

Run linters and formatters only on staged files:

Commit Message Validation

Enforce commit message conventions:

Running Tests

Run tests before pushing: