Skip to main content
MergeGuide git hooks run a policy check at commit and push time, so violations are caught on your machine before they reach a pull request. The CLI installs and manages the hooks for you.
Prerequisite: the MergeGuide CLI, installed and authenticated.

Install

mergeguide hooks install
By default this installs the standard set of hooks for the current repository. To install a specific hook type:
mergeguide hooks install --hook-type pre-commit
Supported hook types are pre-commit, pre-push, commit-msg, post-commit, and all.
If you ran mergeguide init, git hooks were already installed for you.

Check status

mergeguide hooks status

Fleet install

To install hooks across every git repository under a directory:
mergeguide hooks install --all /path/to/repos --dry-run
--dry-run reports what would happen without writing anything. Drop it to apply. Use --max-depth to bound how deep the repo discovery recurses (default 5).

What happens on commit

When you commit, the hook runs MergeGuide against your staged changes:
  • If there are no blocking findings, the commit proceeds.
  • If there are blocking findings, the commit is stopped and the findings are printed so you can fix them.
Bypasses are recorded. You can review the audit log of hook bypasses at any time:
mergeguide hooks bypasses

Remove the hooks

mergeguide hooks uninstall

Next steps

Set up the PR gate

Enforce policy on pull requests across your SCM.

Configuration

Tune which policies run and your fail thresholds.