The following steps should be performed on a freshly generated repository.
Run the following commands to enable LFS for a given repository:
LFS needs to be installed into a repository using this command:
git lfs install
Enable Tracking by File Extenstion
LFS identifies files to be put in LFS by the file name extension. Run the following command to add the most common extensions for large files that should be placed in LFS:
for ext in bin exe jar dmg pkg apk deb rpm msi msu zip rar 7z tar tar.gz tgz gz bz2 xz cab mp4 m4v mkv flv wmv ogv avi mov mp3 m4a m4r au ogg wav wma raw iso img
git lfs track "*.$ext"
Push the changes made by enabling LFS:
git add .gitattributes
git commit -m "add lfs support" .gitattributes