From Old-School Hook Scripts to Git 2.54 Hooks
Traditional Git hooks live as executable files inside .git/hooks in each repository. For everyday PC and laptop workflows, that has meant copy‑pasting pre-commit or pre-push scripts into every project just to auto-run linters, tests, or deployment checks. Those scripts are not versioned with the repo by design, because auto-running arbitrary code from a clone would be a huge security risk. As a result, developers often lose track of what runs where, and teams end up with inconsistent checks across machines and repos. Git 2.54 introduces config based Git hooks: instead of shell scripts sitting in .git/hooks, you can declare hooks directly in git config. Hooks can now be defined at system, global, or local scope and listed centrally using git hook, making it much easier to see and manage what’s actually executing on your dev PC.

What Config-Based Git Hooks Change for Multi-PC and Multi-Repo Devs
Config-based hooks in Git 2.54 let you define hooks once and reuse them across repositories and machines. By placing hook definitions in your global config (for example in $HOME/.gitconfig), you can ensure the same pre-push checks run for every project you work on, without copying scripts into each .git/hooks directory. System-level configs can add organization-wide hooks, while local repo configs can extend or override them. This is a big win if you manage dotfiles, work across dual-boot setups, or maintain dozens of repos on your desktop. You can keep your preferred tooling—formatters, static analyzers, or secret scanners—wired into Git through versioned config files, instead of opaque per-repo scripts. The extended git hook command also shows where each hook is defined, helping you debug unexpected behavior and keep a clear mental model of your developer workflow tips stack.
Parallel Git Hooks in 2.55: Faster Pre-Push Checks on Multi-Core CPUs
Until Git 2.54, all hooks executed sequentially, even if you had eight or more cores sitting idle in your dev rig. If your pre-push hook runs a C++ linter, a memory leak detector, and a security scan, you wait for them one after another. Upcoming Git 2.55 features add parallel Git hooks via simple configuration. You can mark individual hooks as parallel = true and limit global concurrency with hook.jobs, which behaves similarly to fetch.parallel. Setting hook.jobs = -1 tells Git to use all available cores. You can also experiment without touching config by using git hook run -j N. Some events, such as pre-commit and prepare-commit-msg, are intentionally kept serial because they touch shared resources. But for heavy, independent checks tied to pre-push or other events, parallel execution can significantly cut waiting time on desktop and workstation hardware.
Security, Submodules, and Pitfalls When You Flip on Parallel Hooks
The shift to config driven hooks and parallel execution also has security and stability implications. Developers are increasingly attractive targets for attackers; compromised machines give direct access to source code, credentials, and even entire build chains. That’s one reason Git still does not auto-run hooks from cloned repositories: executing untrusted code by default would make supply-chain attacks far easier. Centralized configs help you audit what runs on your system, but you should still treat new tools and scripts with caution. Parallelism is opt-in precisely because Git cannot know whether two hooks share state, write to the same file, or assume a particular order. Race conditions, garbled output, and subtle test flakiness are real risks. Start by parallelizing clearly independent tasks that only read from your working tree and write to separate temp directories, and keep ordering-sensitive logic in non-parallel hooks.
Quick-Start Examples: Linting, Formatting, and Security Scans with New Hooks
To use the new model, define hooks in your global config instead of .git/hooks. For example, you could wire up two pre-push checks that run in parallel on most repos: a linter and a leak or security scanner. Each hook entry specifies an event and a command, and in Git 2.55 you can add parallel = true plus a hook.jobs setting to control concurrency. This setup is ideal for heavy pre-commit checks that would otherwise bog down your workflow. On a typical PC, you might run code formatters and linters before committing, while leaving more expensive tests and security scans for pre-push. Use git hook run to test a single event interactively and verify that outputs look clean and there are no conflicts. Once you’re happy, commit your config files to your dotfiles repo to keep your Git 2.54 hooks setup portable across all your development machines.
