pre-commit

Run Git hook scripts with pre-commit to catch simple issues before code reaches review.

pre-commit.com
pre-commit homepage screenshot

About pre-commit

pre-commit is a package manager for Git hook scripts that runs checks before every commit to identify issues such as missing semicolons, trailing whitespace, and debug statements before code review.

Users list hooks in a .pre-commit-config.yaml file and run pre-commit install so checks run automatically on git commit. Pre-commit manages installation and execution of hooks written in any language and handles required runtimes without root access. During commits it runs on changed files, with support for checking all files and running in CI.

Key features

  • Runs specified hooks automatically before every git commit
  • Manages hook installation across programming languages from config file
  • Downloads and builds missing runtimes without requiring root access
  • Generates starter configuration with pre-commit sample-config command
  • Installs git hook scripts with pre-commit install command
  • Checks all files on demand with run --all-files
Best for: Developers using Git who want automated checks for style and basic errors before review.
Good for
  • Works with hooks written in any programming language
  • Handles required runtimes without requiring root access
  • Runs automatically on git commit after installation

pre-commit at a glance

Type
Website
Pricing
Not confirmed. Check the site
Platforms
Web
Open source
Not stated
Last checked
Oct 5, 2026 · Online when checked
Listed
Oct 5, 2026

pre-commit alternatives

Tools and sites you could use instead, ranked by how closely they match.

All 24 alternatives

Popular in Git & Code Hosting

Well-known listings from the same topic.

All 67

pre-commit FAQ

How do I install pre-commit?
Install with pip install pre-commit, add it to requirements.txt in a Python project, or run the 0-dependency .pyz file from GitHub releases with Python.
How do I enable pre-commit for a project?
Create a .pre-commit-config.yaml file, optionally starting from pre-commit sample-config, then run pre-commit install to set up the git hook scripts.
Does pre-commit check all files or only changed files?
During git hooks it runs on changed files, but you can check everything with pre-commit run --all-files.
Is something wrong or out of date?

Tell us and an editor will check it.

Own this website?

Claim the listing and suggest updates yourself. An editor checks every claim first.

Claim this listing