# simple-git-hooks

> A simple, zero dependency tool for setting up git hooks for small projects

Latest version **2.14.0** (published 2026-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-git-hooks
pnpm add simple-git-hooks
yarn add simple-git-hooks
bun add simple-git-hooks
```

Provides the command `simple-git-hooks`.

## Health

**Score 50/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 2.14.0 |
| Published | 2026-08-28 |
| First published | 2021-03-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 1692 |
| Author | Mikhail Gorbunov |
| Maintainers | toplenboren |
| Keywords | pre-commit, pre-push, git, hook, lint, linter |

## Links

- npm: https://www.npmjs.com/package/simple-git-hooks
- Repository: https://github.com/toplenboren/simple-git-hooks
- Homepage: https://github.com/toplenboren/simple-git-hooks#readme
- Issues: https://github.com/toplenboren/simple-git-hooks/issues
- npm.io page: https://npm.io/package/simple-git-hooks

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 2.14.0 (latest) — 2026-08-28
- 2.13.1 — 2025-07-31
- 2.13.0 — 2025-04-23
- 2.12.1 — 2025-03-20
- 2.11.1 — 2024-03-25
- 2.11.0 — 2024-03-16
- 2.10.0 — 2024-03-03
- 2.9.0 — 2023-07-23
- 2.8.1 — 2022-10-17
- 2.8.0 — 2022-05-28
- 2.7.0 — 2021-10-27
- 2.6.1 — 2021-08-16
- 2.5.1 — 2021-06-27
- 2.4.1 — 2021-04-24
- 2.4.0 — 2021-04-24
- … 8 more at https://npm.io/package/simple-git-hooks/versions

## README

# simple-git-hooks

A simple, zero dependency tool for setting up git hooks for small projects.

## Usage

1. `npm install simple-git-hooks --save-dev`
2. Add to `package.json`:
   ```json
   {
     "simple-git-hooks": {
       "pre-commit": "npx lint-staged",
       "pre-push": "npm run format"
     }
   }
   ```
3. Run `npx simple-git-hooks`
4. Add to `scripts` for auto-install:
   ```json
   { "scripts": { "prepare": "simple-git-hooks" } }
   ```

Config can also go in `.simple-git-hooks.cjs`, `.simple-git-hooks.js`, `.simple-git-hooks.mjs`, `.simple-git-hooks.json`, or `simple-git-hooks.{cjs,js,mjs,json}`.

Use `preserveUnused: true` or `preserveUnused: ["commit-msg"]` to keep unused hooks.

## Uninstall

```sh
node node_modules/simple-git-hooks/uninstall.js
```

## Environment variables

- `SKIP_INSTALL_SIMPLE_GIT_HOOKS=1` — skip hook installation
- `SKIP_SIMPLE_GIT_HOOKS=1` — skip hooks for a git operation
- `SIMPLE_GIT_HOOKS_RC` — path to an init script (for node version managers)

Full documentation: https://github.com/toplenboren/simple-git-hooks

---
_Source: https://npm.io/package/simple-git-hooks · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
