Skip to content

Migrating from Husky

forge ships a migrate command that converts a legacy .git-hooks.config.json to forge.toml.

Run the migration

sh
forge migrate --from .git-hooks.config.json --to forge.toml

Review the generated forge.toml before committing — the migrator covers common patterns but may not capture every edge case.

Then install hooks

sh
forge install

Remove the old hook runner

sh
# Remove Husky
npm uninstall husky
rm -rf .husky

# Remove legacy config (after verifying forge.toml is correct)
rm .git-hooks.config.json

Differences to be aware of

Behaviour.git-hooks.config.jsonforge.toml
Tool orderingArray orderDeclaration order in forge.toml
Skip env varsSKIP_PRECOMMIT=1Same
DDEV detectionManual wrappersbackend = "ddev"
Commit-msg policyNot supported[hooks.commit-msg.policy]

See also

Released under the MIT License.