The Tech Meta

An inside look at tech's evolving playbook

Git hooks

Test observed

Scripts git runs before a commit or a push, such as a linter on the changed files.

Scripts that git runs on a developer's machine at set moments, most often before a commit or a push: format the staged files, run the linter, check the commit message, look for secrets. Git does not share hooks through a clone, so teams install them with a tool: husky or simple-git-hooks in JavaScript, lefthook, or the pre-commit framework, each set up by a file in the repo. An agent that commits runs into the same hooks. The site counts a repo when it holds the config of one of these tools, or a folder of hook scripts.

  • Pro scene today: 54%, 119 of 221 pro repos
  • In three months: −<1 pt (1 pro repo removed it)
  • Kept: 96%, 119 of 124 that had it 3 months ago or before

Pro 54% · Ladder 28% · 1.9×

In the pro repos

The 6 most starred of the 119 pro repos that have it today.

By month

MonthPro scene
June 202548%
July 202548%
August 202548%
September 202548%
October 202549%
November 202549%
December 202550%
January 202652%
February 202652%
March 202651%
April 202652%
May 202654%
June 202654%
July 202654%
August 202655%
September 202654%
October 202654%
November 202654%
today54%

Inside the practice

What git hooks run

Of the repos with git hooks. Read from the hook scripts and configs.

  • A linter or a formatter: 82%, 98 of 119
  • A type check: 19%, 23 of 119
  • A secret scan: 12%, 14 of 119
  • Tests: 3%, 4 of 119

Evidence

Observed in the repos only: no published study is quoted for it yet.

How it is detected

Looks for husky, lefthook, simple-git-hooks, pre-commit or a folder of hook scripts. Read in repo files. How the method counts

Related practices

More in Test, the most adopted first.

Levels of evidence