stage_fixed
Default: false
Works only for
pre-commithook
When set to true lefthook will automatically call git add on files after running the command or script. For a command if files option was specified, the specified command will be used to retrieve files for git add. For scripts and commands without files option {staged_files} template will be used. All filters (glob, exclude) will be applied if specified.
Example
# lefthook.yml
pre-commit:
commands:
lint:
run: npm run lint --fix {staged_files}
stage_fixed: true