`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.
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