Interview Prep/Git & GitHub/Submodules, LFS and Hooks

Your pre-commit hook never runs, and Git prints `hint: The '.git/hooks/pre-commit' hook was ignored because it's not set as executable.`

BeginnerTroubleshootingSubmodules, LFS and Hooks
Answer

Likely causes → The hook file lacks the execute bit (created in an editor, copied from Windows, or extracted from an archive).

Diagnose → ls -l .git/hooks/pre-commit

Fix → chmod +x .git/hooks/pre-commit. Also check the shebang line (#!/usr/bin/env bash) and that the file has no .sample suffix.

Prevent → Keep hooks in the repo (e.g. .githooks/) committed with mode 100755 (git update-index --chmod=+x .githooks/pre-commit), and install them with a script.

All Git & GitHub questions Roadmap: Git & GitHub

More on Submodules, LFS and Hooks