Git Clients

CaptainHook – flexible Git hook manager

CaptainHook is a flexible Git hook manager for PHP developers that helps teams share and enforce repository workflows through a simple JSON configuration file.

It can run checks before commits and pushes, validate or prepare commit messages, and trigger follow-up tasks after operations such as merges, checkouts, and rebases. The project is designed to make Git hooks easier to maintain across teams while still allowing developers to extend the system with their own PHP logic when needed.

This is free and open source software.

Key Features

  • Supports common Git hooks including pre-commit, pre-push, prepare-commit-msg, commit-msg, post-commit, post-checkout, post-merge, and post-rewrite.
  • Provides virtual hooks such as post-change to avoid duplicating configuration across related Git events.
  • Lets you define hook behaviour in a captainhook.json file with per-hook enable switches and action lists.
  • Can execute CLI commands such as test suites, linters, and code quality tools as hook actions.
  • Supports custom PHP action classes, static method calls, and custom rules for commit message validation.
  • Includes conditions and placeholders so actions can respond to staged files, changed files, hook arguments, environment variables, and configuration values.
  • Allows shared and reusable setups by including other CaptainHook configuration files.
  • Offers configurable run modes and settings, including support for Docker-based execution.

Website: github.com/captainhook-git/captainhook
Support:
Developer: Sebastian Feldmann
License: MIT License

CaptainHook is written in PHP. Learn PHP with our recommended free books and free tutorials.


Related Software

Git Hook Managers
lefthookGit hooks manager for Node.js, Ruby, Python and more
huskyGit hooks made easy
pre-commitManage and maintain multi-language pre-commit hooks
prekReimagined version of pre-commit
overcommitManage and configure Git hooks
hkGit hooks manager and project linting tool focusing on performance
simple-git-hooksSimple git hooks manager for small projects
CaptainHookFlexible Git hook manager
GithooksPlatform-independent hooks manager
git-hooksRewritten from icefox/git-hooks, with extra features
JigGit pre-commit hook on steroids

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our carefully curated directory of recommended free and open source software, covering every major software category.

The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more.

Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted