PHPackages                             ams/git-hooks-installer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ams/git-hooks-installer

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

ams/git-hooks-installer
=======================

This composer plugin helps you automate the installation git hooks into your project.

1.0.0(8y ago)16.8k2MITPHPPHP &gt;=5.5

Since Jul 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/amansilla/git-hooks-composer-installer)[ Packagist](https://packagist.org/packages/ams/git-hooks-installer)[ Docs](https://github.com/amansilla/git-hooks-composer-installer)[ RSS](/packages/ams-git-hooks-installer/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (3)Versions (7)Used By (0)

Git Hooks Composer Installer
============================

[](#git-hooks-composer-installer)

[![Build Status](https://camo.githubusercontent.com/c71b9ae500120f5f19849975e564386594a026a4532b658266425590992d4c2e/68747470733a2f2f7472617669732d63692e6f72672f616d616e73696c6c612f6769742d686f6f6b732d636f6d706f7365722d696e7374616c6c65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/amansilla/git-hooks-composer-installer)[![Build status](https://camo.githubusercontent.com/f4056381eac5beeb2081920de5c1d8eced38ddc23c167b28be4a6246802eadc1/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f6a387833756a39367965616a6637716a2f6272616e63682f6d61737465723f7376673d74727565)](https://ci.appveyor.com/project/amansilla/git-hooks-composer-installer/branch/master)[![Latest Stable Version](https://camo.githubusercontent.com/b6aecc00850c7ff1cae7cd5523f21e47720bc1c21873c0e88271f8d4ea5a7bc5/68747470733a2f2f706f7365722e707567782e6f72672f616d732f6769742d686f6f6b732d696e7374616c6c65722f762f737461626c65)](https://packagist.org/packages/ams/git-hooks-installer)[![Total Downloads](https://camo.githubusercontent.com/466958b4f6b81d369488646739d255342f3b4c4cec28e1fa71ee21a939e88b6f/68747470733a2f2f706f7365722e707567782e6f72672f616d732f6769742d686f6f6b732d696e7374616c6c65722f646f776e6c6f616473)](https://packagist.org/packages/ams/git-hooks-installer)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/53322bb4c03d260238a8abf2882f7335087aa34bf8f9f750c2a19d1c577520b9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616d616e73696c6c612f6769742d686f6f6b732d636f6d706f7365722d696e7374616c6c65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/amansilla/git-hooks-composer-installer/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/6966bd49965bd14a8e6e2e693f3ee87b63c1ad38292b5009751a484f3ff67149/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f63313031353238332d643265342d343962362d383039342d6233313837383733653530652f6d696e692e706e67)](https://insight.sensiolabs.com/projects/c1015283-d2e4-49b6-8094-b3187873e50e)[![License](https://camo.githubusercontent.com/4635c86a493be977f6774aa85da707f0692efe7b3873b65e06cbe0bd7da837a8/68747470733a2f2f706f7365722e707567782e6f72672f616d732f6769742d686f6f6b732d696e7374616c6c65722f6c6963656e7365)](https://packagist.org/packages/ams/git-hooks-installer)

Latest release: [1.0.0](https://packagist.org/packages/ams/git-hooks-installer#1.0.0)

This plugin helps you automate the installation git hooks using [composer](https://getcomposer.org/).

Installation
------------

[](#installation)

Just run the following command:

```
$ composer require --dev ams/git-hooks-installer

```

or if you prefer add the following to the `composer.json` file:

```
{
    "require-dev": {
        "ams/git-hooks-installer": "^1.0"
    },
    "extra": {
        "git-root-dir": "."
    }
}

```

Usage
-----

[](#usage)

When the git-hooks-composer installer is run, it only looks for git-hooks among your project dependencies. If your package is a git hook and you want it to be installed with composer automatically you'll need to define a `composer.json` as follows:

```
{
    "type": "git-hook"
}

```

The git hooks scripts should be located in the package root directory. Currently are the following git hooks supported:

- `applypatch-msg`
- `pre-applypatch`
- `post-applypatch`
- `pre-commit`
- `prepare-commit-msg`
- `commit-msg`
- `post-commit`
- `pre-rebase`
- `post-checkout`
- `post-merge`
- `pre-push`
- `pre-auto-gc`
- `post-rewrite`

You can find any additional information about the git hooks on the [git documentation](https://git-scm.com/docs/githooks) online.

Contribute
----------

[](#contribute)

Contributions to are very welcome!

- Report any bugs or issues you find on the [issue tracker](https://github.com/amansilla/git-hooks-composer-installer/issues).

Support
-------

[](#support)

If you are having problems, send a mail to  or just write me [@flamingek](https://twitter.com/flamingek) on Twitter.

License
-------

[](#license)

All contents of this package are licensed under the [MIT license](LICENSE).

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity62

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~134 days

Total

5

Last Release

3082d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/da3f659ef14cc6f402a550e17ed68b7faced4157c5605b5dfb8d734f67e0f963?d=identicon)[amansilla](/maintainers/amansilla)

---

Tags

automationcomposergitgit-hookshook-managerhooksplugin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ams-git-hooks-installer/health.svg)

```
[![Health](https://phpackages.com/badges/ams-git-hooks-installer/health.svg)](https://phpackages.com/packages/ams-git-hooks-installer)
```

###  Alternatives

[symfony/runtime

Enables decoupling PHP applications from global state

74694.9M938](/packages/symfony-runtime)[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k40.0M2.6k](/packages/ergebnis-composer-normalize)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5344.1M526](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2124.0M193](/packages/drupal-core-project-message)[sandersander/composer-link

Adds ability to link local packages for development with composer

94441.4k](/packages/sandersander-composer-link)[phpro/grumphp-shim

GrumPHP Phar distribution

284.6M333](/packages/phpro-grumphp-shim)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
