
About pre-commit
pre-commit is an open source framework for managing git hook scripts, such as linters and formatters, across many languages. It installs and runs each hook for you, so you do not need to set up every tool by hand.
What it does
You list the hooks you want in a configuration file in your repository. pre-commit then downloads and builds each hook in its own environment and runs them before every commit. The idea is to catch simple problems, such as trailing whitespace or leftover debug statements, before code review. It is designed to work without root access.
Key features
- Hooks installed in isolated environments
- Runs before every commit
- Shares hook setups across projects
- Works without root access
- Command line interface for running hooks by hand
Who it's for
pre-commit suits teams with projects in several languages that want the same checks everywhere. It is also useful for maintainers who want contributors to see style issues before a review.
Pricing and good to know
The project is open source under the MIT license. It can be installed with pip or as a single zipapp file. Each developer needs it installed locally for the hooks to run on commit.
Highlights
- Installs each hook in its own environment
- Runs configured hooks before every commit
- Shares hook setups across projects
- Works without root access
- Runs hooks by hand from the command line












