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

`git push` fails with `This repository is configured for Git LFS but 'git-lfs' was not found on your path.`

BeginnerTroubleshootingSubmodules, LFS and Hooks
Answer

Likely causes → The repo has LFS hooks in .git/hooks/pre-push, but the git-lfs binary is not installed or not on the PATH of the program running Git (often a GUI client or IDE with a minimal PATH).

Diagnose →

which git-lfs; git lfs version
cat .git/hooks/pre-push

Fix → Install Git LFS (brew install git-lfs, apt install git-lfs, or bundled with Git for Windows), then git lfs install. For GUI clients, make sure they use the system Git or have the right PATH.

Prevent → Standardize developer tooling (devcontainer or bootstrap script) that installs git-lfs.

All Git & GitHub questions Roadmap: Git & GitHub

More on Submodules, LFS and Hooks