Repolode
sds

sds/overcommit

A configurable Git hook manager written in Ruby that runs linters, tests and custom scripts on commit, push and other Git events.

Stars
4,005
Forks
291
Open issues
34
Last commit
yesterday

What is it?

Overcommit manages Git hooks for a repository so that checks such as linters, test runners and formatters run automatically at points like pre-commit, commit-msg, pre-push and post-checkout. Hook behavior is set in a per-repository .overcommit.yml file, which can enable or disable individual hooks, control which files they apply to, and tune options such as parallel execution and failure handling.

The project ships with a large set of built-in hooks covering languages and tools including Ruby (RuboCop, RSpec), JavaScript (ESLint, Stylelint), Python (Pylint, Flake8), Go, PHP, Java and Shell, plus generic checks for trailing whitespace, merge conflict markers and file sizes. Teams can also write repo-specific hooks in Ruby, or register an existing shell script as a hook without writing Ruby code.

Configuration can be shared through source control, while a .local-overcommit.yml file allows personal overrides. Overcommit also records a signature of hook code and configuration so that changes made by others are flagged before the hooks run again.

Key features

  • 01Runs hooks on many Git events, including pre-commit, commit-msg, pre-push and post-checkout.
  • 02Ships with a large set of built-in linters and test runners for common languages.
  • 03Lets you add existing shell scripts as hooks without writing Ruby.
  • 04Supports per-hook file filters, branch exclusions and parallel execution.
  • 05Provides a --run mode to check an entire repository in CI.

Use cases

  • Running RuboCop or ESLint automatically before each commit in a team repository.
  • Blocking pushes to protected branches or commits with merge conflict markers.
  • Running the same lint suite in CI as developers run locally before committing.

Quick start

  1. 1

    Install the overcommit gem via RubyGems

    gem install overcommit
  2. 2

    Go to your repository and initialize Git if needed

    git init
  3. 3

    Install the Overcommit hooks into the repository

    overcommit --install

Things to know

  • Some hooks depend on third-party tools (for example scss_lint), which you must install yourself.
  • Requires a Ruby environment, with Ruby 2.6+ on *nix and only best-effort support on Windows.

In collections

Topics

FAQ

What is overcommit?
A configurable Git hook manager written in Ruby that runs linters, tests and custom scripts on commit, push and other Git events. Overcommit manages Git hooks for a repository so that checks such as linters, test runners and formatters run automatically at points like pre-commit, commit-msg, pre-push and post-checkout. Hook behavior is set in a per-repository .overcommit.yml file, which can enable or disable individual hooks, control which files they apply to, and tune options such as parallel execution and failure handling.
Is overcommit free to use? What license does it have?
overcommit is open source under the MIT license. Check the license terms before using it in commercial products.
Is overcommit still maintained?
Actively maintained. The last commit to overcommit was on Nov 6, 2026.
What can I use overcommit for?
Running RuboCop or ESLint automatically before each commit in a team repository. Blocking pushes to protected branches or commits with merge conflict markers. Running the same lint suite in CI as developers run locally before committing.
How do I install overcommit?
Install the overcommit gem via RubyGems: gem install overcommit Go to your repository and initialize Git if needed: git init Install the Overcommit hooks into the repository: overcommit --install
Where can I get overcommit?
The source code and installation instructions are on GitHub: https://github.com/sds/overcommit

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects