Interview Prep/Git & GitHub/Hooks, submodules, LFS and signing

How do you migrate existing large files into LFS?

AdvancedConceptHooks, submodules, LFS and signing
Answer

Use git lfs migrate import, which rewrites history so matching files become pointers. It rewrites commits, so everyone must re-clone, and protected branches need temporary adjustment.

git lfs migrate import --include="*.zip,*.psd" --everything
git push --force-with-lease --all
All Git & GitHub questions Roadmap: Git & GitHub

More on Hooks, submodules, LFS and signing