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

You ran `git lfs track "*.psd"` and committed, but clones are still huge.

AdvancedTroubleshootingSubmodules, LFS and Hooks
Answer

Likely causes → git lfs track only affects future commits. All the old PSD versions are still regular blobs in history.

Diagnose →

git lfs migrate info --everything --include="*.psd"
git count-objects -vH

Fix → Rewrite history so past versions become LFS pointers (in a fresh clone, coordinated with the team):

git lfs migrate import --include="*.psd" --everything
git push --force --all && git push --force --tags

Everyone must re-clone; open PRs need rebasing onto the new history.

Prevent → Decide on LFS patterns at repo creation and block large binaries with a size limit rule.

All Git & GitHub questions Roadmap: Git & GitHub

More on Submodules, LFS and Hooks