The pre-commit hook takes 90 seconds on every commit, so people start using `--no-verify`.
IntermediateTroubleshootingSubmodules, LFS and Hooks
Answer
Likely causes → The hook lints, type-checks or tests the entire repo instead of the staged files, or downloads tools on every run.
Diagnose → time .git/hooks/pre-commit, then read what it runs.
Fix → Run checks only on staged files and move heavy work to CI:
# get staged files for a custom hook
git diff --cached --name-only --diff-filter=ACMR -- '*.py' | xargs -r ruff check
With the pre-commit framework, hooks already receive only staged files; with JS repos use lint-staged. Keep full test suites in pre-push or CI.
Prevent → Set a budget (a few seconds) for pre-commit hooks and measure it when adding new ones.
More on Submodules, LFS and Hooks
`fatal: No url found for submodule path 'libs/common' in .gitmodules`IntermediateAfter cloning, the submodule directories exist but are empty.Beginner`git submodule update` fails: `fatal: remote error: upload-pack: not our ref 3f2a9c1...` and `Fetched in submodule path 'libs/common', but it did not contain 3f2a9c1. Direct fetching of that commit failed.`Intermediate`git status` keeps showing `modified: libs/common (new commits)` even though you never touched it.BeginnerYou committed inside a submodule, ran `git submodule update`, and your commits vanished.Intermediate`git submodule add` fails with `fatal: 'libs/common' already exists in the index`.Intermediate