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

`git status` or a clone prints `Encountered 3 file(s) that should have been pointers, but weren't:`

IntermediateTroubleshootingSubmodules, LFS and Hooks
Answer

Likely causes → Files matching an LFS pattern in .gitattributes were committed as regular blobs, because the committer lacked LFS or the pattern was added after the files.

Diagnose →

git lfs fsck --pointers
git check-attr filter -- assets/logo.psd

Fix → Convert them in a new commit:

git add --renormalize .
git commit -m "Store tracked files in LFS"

To also clean history: git lfs migrate import --include="*.psd" --everything and force-push.

Prevent → Add .gitattributes patterns before adding files, and run git lfs fsck --pointers in CI.

All Git & GitHub questions Roadmap: Git & GitHub

More on Submodules, LFS and Hooks