Skip to content

Playbooks for g

Story-style workflows—solo, team, and on-call. Jump into the full Use cases page anytime.

hooks

Personal git hooks system.

auto-generated This page is built from //! comments in the Rust source. Edit the source and run npm run docs:extract to update it.

Personal git hooks system.

Runs user-configured hooks alongside (not replacing) existing hook systems like Husky. Hooks are configured per-repo or globally, and can filter by staged files.

Usage

use crate::hooks;

// In g commit, before git commit:
if !args.no_verify {
    hooks::run_pre_commit()?;
}

// After git commit succeeds:
hooks::run_post_commit()?;

Configuration

Hooks are configured in .g/hooks.toml (repo-local) or ~/.config/g/hooks/<repo-name>.toml (global per-repo).

Source: src/hooks/mod.rs