Skip to main content
The pre-push hook runs in front of git push. If any file in your project scores below your threshold, the push is blocked and the offending files are listed. Catching it here means nothing reaches the remote, so there is nothing to revert and no one else has to review it first.
The git pre-push hook requires Iris Code Pro.

Installing

Run Iris Code: Install Git Hook from the command palette. Iris Code writes .git/hooks/pre-push and makes it executable. On first activation in a git repository, Iris Code also offers to install it for you. Declining is remembered per workspace, so you are not asked again.

What happens on push

The hook resolves your project root, runs iris check using the bundled CLI, and either blocks with the list above or exits cleanly and allows the push.

Configuring the threshold

Set minHealthScore in .irisconfig.json to control the minimum acceptable score. It defaults to 70.
On an established codebase, an absolute threshold can block a large share of the project from the first day, which usually ends with the hook being uninstalled. gateBaselineMode avoids that. Each existing file is judged against its own locked score, so the rule becomes “do not make this worse” rather than “fix everything first”. New files still have to clear minHealthScore.
An existing pre-push hook is left intact. Iris Code appends its own block between # >>> iris-hook-start <<< and # >>> iris-hook-end <<< markers, so anything already in the file continues to run.

Insights tracking

Every hook run is recorded as a pass or fail in your account Insights, so enforcement activity is visible over time without reading terminal history. See iriscode.co/account/insights.

Uninstalling

Run Iris Code: Uninstall Git Hook. Only the Iris Code block between the markers is removed. If that leaves nothing but a shebang, the hook file is deleted.