Remote and Shared Hook Configurations
Intermediatev1.0.0
Share Lefthook configurations across repositories using remote hooks — centralized organizational standards, versioned hook templates, and per-project overrides.
Content
Overview
Lefthook's remote hooks feature lets you share hook configurations across multiple repositories. Define organizational standards in a central repository and inherit them in every project — with per-project overrides for specific needs.
How It Works
Central Hook Repository
Consuming Remote Hooks
Versioned Remote Hooks
Override Remote Commands
Best Practices
- -Pin remote hooks to tagged versions (not branch names) for stability
- -Use
mainbranch only for critical security checks that should update automatically - -Allow per-project overrides for commands that do not apply everywhere
- -Version your shared hooks repository with semantic versioning
- -Test shared hook changes in a staging project before rolling out org-wide
- -Document available shared hooks in your organization's developer guide
Common Mistakes
- -Using
mainbranch for all remote hooks (breaking changes affect all projects) - -Not allowing per-project overrides (forces one-size-fits-all)
- -Not versioning the shared hooks repository (no rollback capability)
- -Adding project-specific logic to shared hooks (should be generic)
FAQ
Discussion
Loading comments...