PHPackages                             spryker/git-hook - 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. spryker/git-hook

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

spryker/git-hook
================

Spryker Git hooks

5855.9k—3.9%5PHPCI passing

Since Oct 2Pushed 7mo ago61 watchersCompare

[ Source](https://github.com/spryker/git-hook)[ Packagist](https://packagist.org/packages/spryker/git-hook)[ RSS](/packages/spryker-git-hook/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

GitHook
=======

[](#githook)

[![CI](https://github.com/spryker/git-hook/actions/workflows/ci.yml/badge.svg)](https://github.com/spryker/git-hook/actions/workflows/ci.yml)[![Minimum PHP Version](https://camo.githubusercontent.com/9c50dc780fa576f5c39b4feff00c05345c1471be0808881a09e750b91220dc54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e332d3838393242462e737667)](https://php.net/)[![PHPStan](https://camo.githubusercontent.com/f60d96f7c2579690ab6dfa8918f777fe93a02a92301c661eb38a85861a92b780/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230382d627269676874677265656e2e7376673f7374796c653d666c6174)](https://phpstan.org/)[![License](https://camo.githubusercontent.com/de098e121ab534b58bc2c46b9e4031e37b3cd0b65b7580dd584902b1f03aa592/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f737072796b65722f6769742d686f6f6b2e737667)](https://packagist.org/packages/spryker/git-hook)

GitHook for Spryker. This tool will add Git hooks to your local hooks directory.

Currently, we have only one hook named `pre-commit`. This will execute on every commit the applied commands.

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

[](#installation)

```
composer require --dev spryker/git-hook

```

### Setup

[](#setup)

Add the Composer scripts to your composer.json

#### For core

[](#for-core)

```
    "scripts": {
        "post-install-cmd": [
        "GitHook\\Composer\\Scripts\\HookInstaller::installSprykerHooks",
        "GitHook\\Composer\\Scripts\\HookInstaller::installEcoHooks"
    ],
    "post-update-cmd": [
        "GitHook\\Composer\\Scripts\\HookInstaller::installSprykerHooks",
        "GitHook\\Composer\\Scripts\\HookInstaller::installEcoHooks"
    ]

```

#### For projects

[](#for-projects)

```
  "scripts": {
    "post-install-cmd": [
      "GitHook\\Composer\\Scripts\\HookInstaller::installProjectHooks"
    ],
    "post-update-cmd": [
      "GitHook\\Composer\\Scripts\\HookInstaller::installProjectHooks"
    ]
  }

```

This will copy the git hooks to your `.git/hooks/` directory.

Configuration
-------------

[](#configuration)

Place a `.githook` file into the root of your project. Inside of this file you can configure the commands.

You can also use your private configuration by creating a `.githook_local` file and ignore it in your projects .gitignore` file.

### Enable commands

[](#enable-commands)

To enable commands you need to specify them. An example configuration could look like this:

```
preCommitFileCommands:
    - GitHook\Command\FileCommand\PreCommit\ArchitectureCheckCommand
    - GitHook\Command\FileCommand\PreCommit\CodeStyleCheckCommand
    - GitHook\Command\FileCommand\PreCommit\CodeStyleFixCommand
    - GitHook\Command\FileCommand\PreCommit\PhpMdCheckCommand
    - GitHook\Command\FileCommand\PreCommit\PhpStanCheckCommand

preCommitRepositoryCommands:
    - GitHook\Command\RepositoryCommand\PreCommit\ValidateBranchNameCommand
    - GitHook\Command\RepositoryCommand\PreCommit\GitAddCommand

```

See the full list of available commands in `src/GitHook/Command/FileCommand/` and `src/GitHook/Command/RepositoryCommand/`.

Note: `GitHook\Command\RepositoryCommand\PreCommit\GitAddCommand` will automatically add all new files into commit, when other commands changed the files ( `CodeStyleFixCommand` does it for example), so use it only when you really need it!

### PhpStanCheckCommand configuration

[](#phpstancheckcommand-configuration)

```
config:
    phpstan:
        level: 8
        config: .phpstan.neon

```

Commands
--------

[](#commands)

We have two different type of commands. FileCommands will be executed for each file of a given commit. RepositoryCommands will be executed on the whole repository.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance44

Moderate activity, may be stable

Popularity43

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10738957?v=4)[Spryker Bot](/maintainers/spryker-bot)[@spryker-bot](https://github.com/spryker-bot)

---

Top Contributors

[![stereomon](https://avatars.githubusercontent.com/u/1382877?v=4)](https://github.com/stereomon "stereomon (76 commits)")[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (46 commits)")[![andrew-maslov](https://avatars.githubusercontent.com/u/37797323?v=4)](https://github.com/andrew-maslov "andrew-maslov (12 commits)")[![matweew](https://avatars.githubusercontent.com/u/454530?v=4)](https://github.com/matweew "matweew (6 commits)")[![dmiseev](https://avatars.githubusercontent.com/u/32021063?v=4)](https://github.com/dmiseev "dmiseev (6 commits)")[![pushokwhite](https://avatars.githubusercontent.com/u/4017411?v=4)](https://github.com/pushokwhite "pushokwhite (5 commits)")[![serhiisikachov](https://avatars.githubusercontent.com/u/18240804?v=4)](https://github.com/serhiisikachov "serhiisikachov (5 commits)")[![olhalivitchuk](https://avatars.githubusercontent.com/u/77281282?v=4)](https://github.com/olhalivitchuk "olhalivitchuk (5 commits)")[![asmarovydlo](https://avatars.githubusercontent.com/u/15832795?v=4)](https://github.com/asmarovydlo "asmarovydlo (4 commits)")[![marek-obuchowicz](https://avatars.githubusercontent.com/u/712751?v=4)](https://github.com/marek-obuchowicz "marek-obuchowicz (3 commits)")[![romanhavrylko](https://avatars.githubusercontent.com/u/70894038?v=4)](https://github.com/romanhavrylko "romanhavrylko (3 commits)")[![artem-png](https://avatars.githubusercontent.com/u/15310986?v=4)](https://github.com/artem-png "artem-png (3 commits)")[![gechetspr](https://avatars.githubusercontent.com/u/42143273?v=4)](https://github.com/gechetspr "gechetspr (3 commits)")[![a-sabaa](https://avatars.githubusercontent.com/u/1667759?v=4)](https://github.com/a-sabaa "a-sabaa (3 commits)")[![Nidhognit](https://avatars.githubusercontent.com/u/13098647?v=4)](https://github.com/Nidhognit "Nidhognit (2 commits)")[![JimPanse2k19](https://avatars.githubusercontent.com/u/48799819?v=4)](https://github.com/JimPanse2k19 "JimPanse2k19 (2 commits)")[![limeeugenia](https://avatars.githubusercontent.com/u/25685017?v=4)](https://github.com/limeeugenia "limeeugenia (2 commits)")[![demkos](https://avatars.githubusercontent.com/u/2093777?v=4)](https://github.com/demkos "demkos (2 commits)")[![geega](https://avatars.githubusercontent.com/u/1426310?v=4)](https://github.com/geega "geega (2 commits)")[![zyuzka](https://avatars.githubusercontent.com/u/12764988?v=4)](https://github.com/zyuzka "zyuzka (1 commits)")

### Embed Badge

![Health badge](/badges/spryker-git-hook/health.svg)

```
[![Health](https://phpackages.com/badges/spryker-git-hook/health.svg)](https://phpackages.com/packages/spryker-git-hook)
```

###  Alternatives

[awes-io/table-builder

A component that allows creating responsive HTML tables or lists from data object

4726.1k4](/packages/awes-io-table-builder)

PHPackages © 2026

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