Skip to content
Docs CLI

Git hooks

How gridtrue wires into git without fighting it.

gridtrue hooks install adds two small shims under .git/hooks that call the daemon. The shims are idempotent, preserve any pre-existing hook by wrapping it, and can be removed with gridtrue hooks uninstall.

pre-commit
Runs the fast-path validations from pipelines.pre-commit. Blocks the commit if the manifest says they are required.
pre-push
Runs pipelines.pre-push, broadcasts attestations, and queries policy for the target ref. Pushes without sufficient attestations are refused locally before touching the network.

Wrapping an existing hook

If your repo already has a pre-commit or pre-push script (Husky, lefthook, a custom bash file, anything), gridtrue hooks install renames it to .git/hooks/<name>.pre-gridtrue and calls it from the shim. Your existing checks keep running; gridtrue runs after them.

Removing the hooks

bash
gridtrue hooks uninstall   # restores any wrapped previous hook