Lefthook Git Hooks Manager
Lefthook is a fast, dependency-free Git hooks manager written in Go that runs pre-commit, pre-push, and custom hook commands in parallel. It integrates with Node.js, Ruby, Python, and any other project type through a simple YAML configuration.
Installation
Use the upstream install or setup path that matches your environment:
- go install github.com/evilmartians/lefthook/v2@v2.1.6
- npm install lefthook --save-dev
- gem install lefthook
- pipx install lefthook
Requirements and caveats from upstream:
- A Git hooks manager for Node.js, Ruby, Python and many other types of projects.
- For Python:
Support Docker
Basic usage or getting-started notes:
Fast. It is written in Go. Can run commands in parallel.
With Go (>= 1.26):
bash
Extracted from upstream docs: https://raw.githubusercontent.com/evilmartians/lefthook/HEAD/README.md