Add commonly used binaries to git LFS
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
As projects grow in size and scope it can be hard to predict which binaries your team might need to track via git LFS. With this in mind, we have a quick command to track the most common (in our experience) binaries seen within Bitbucket. You can use this command on your repositories to add all the listed extensions below to your .gitattributes file so that you can be sure they'll be tracked properly.
Diagnosis
You can check the files being currently tracked via git LFS by running the command below on the root folder of your repository:
cat .gitattributes
Here's an example output of a repository tracking both "*.exe" and "*.iso" files on git LFS:
*.exe filter=lfs diff=lfs merge=lfs -text
*.iso filter=lfs diff=lfs merge=lfs -text
Solution
A quick way of adding the most commonly used binaries would be running the command below directly on your repository root folder:
git lfs track {"*.3ds","*.3g2","*.3gp","*.7z","*.a","*.aac","*.adp","*.ai","*.aif","*.aiff","*.alz","*.ape","*.apk","*.ar","*.arj","*.asf","*.au","*.avi","*.bak","*.baml","*.bh","*.bin","*.bk","*.bmp","*.BMP","*.btif","*.bz2","*.bzip2","*.cab","*.caf","*.cgm","*.class","*.cmx","*.cpio","*.cr2","*.csv","*.cur","*.dat","*.dcm","*.deb","*.dex","*.djvu","*.dll","*.dmg","*.dng","*.doc","*.docm","*.docx","*.dot","*.dotm","*.dra","*.DS_Store","*.dsk","*.dts","*.dtshd","*.dvb","*.dwg","*.dxf","*.ecelp4800","*.ecelp7470","*.ecelp9600","*.egg","*.eol","*.eot","*.epub","*.exe","*.f4v","*.fbs","*.fh","*.fla","*.flac","*.fli","*.flv","*.fpx","*.fst","*.fvt","*.g3","*.gif","*.GIF","*.graffle","*.gz","*.gzip","*.h261","*.h263","*.h264","*.icns","*.ico","*.ief","*.img","*.ipa","*.iso","*.jar","*.jpeg","*.JPEG","*.jpg","*.JPG","*.jpgv","*.jpm","*.jxr","*.key","*.ktx","*.lha","*.lib","*.lvp","*.lz","*.lzh","*.lzma","*.lzo","*.m3u","*.m4a","*.m4v","*.mar","*.mdi","*.mht","*.mid","*.midi","*.mj2","*.mka","*.mkv","*.mmr","*.mng","*.mobi","*.mov","*.movie","*.mp3","*.mp4","*.mp4a","*.mpeg","*.mpg","*.mpga","*.mxu","*.nef","*.npx","*.numbers","*.o","*.oga","*.ogg","*.ogv","*.otf","*.pages","*.pbm","*.pcx","*.pdb","*.pdf","*.pea","*.pgm","*.pic","*.png","*.PNG","*.pnm","*.pot","*.potm","*.potx","*.ppa","*.ppam","*.ppm","*.pps","*.ppsm","*.ppsx","*.ppt","*.pptm","*.pptx","*.psd","*.pya","*.pyc","*.pyo","*.pyv","*.qt","*.rar","*.ras","*.raw","*.resources","*.rgb","*.rip","*.rlc","*.rmf","*.rmvb","*.rtf","*.rz","*.s3m","*.s7z","*.scpt","*.sgi","*.shar","*.sil","*.sketch","*.slk","*.smv","*.so","*.sub","*.swf","*.tar","*.tbz","*.tbz2","*.tga","*.tgz","*.thmx","*.tif","*.tiff","*.tlz","*.ttc","*.ttf","*.txz","*.udf","*.uvh","*.uvi","*.uvm","*.uvp","*.uvs","*.uvu","*.viv","*.vob","*.war","*.wav","*.wax","*.wbmp","*.wdp","*.weba","*.webm","*.webp","*.whl","*.wim","*.wm","*.wma","*.wmv","*.wmx","*.woff","*.woff2","*.wvx","*.xbm","*.xif","*.xla","*.xlam","*.xls","*.xlsb","*.xlsm","*.xlsx","*.xlt","*.xltm","*.xltx","*.xm","*.xmind","*.xpi","*.xpm","*.xwd","*.xz","*.z","*.zip","*.zipx"}
You can read more regarding file extensions here. Down below you can find a comprehensive list of the extensions added via the command above:
*.3ds | *.mp4 | *.ecelp7470 | *.sil |
*.3g2 | *.mp4a | *.ecelp9600 | *.sketch |
*.3gp | *.mpeg | *.egg | *.slk |
*.7z | *.mpg | *.eol | *.smv |
*.a | *.mpga | *.eot | *.so |
*.aac | *.mxu | *.epub | *.sub |
*.adp | *.nef | *.exe | *.swf |
*.ai | *.npx | *.f4v | *.tar |
*.aif | *.numbers | *.fbs | *.tbz |
*.aiff | *.o | *.fh | *.tbz2 |
*.alz | *.oga | *.fla | *.tga |
*.ape | *.ogg | *.flac | *.tgz |
*.apk | *.ogv | *.fli | *.thmx |
*.ar | *.otf | *.flv | *.tif |
*.arj | *.pages | *.fpx | *.tiff |
*.asf | *.pbm | *.fst | *.tlz |
*.au | *.pcx | *.fvt | *.ttc |
*.avi | *.pdb | *.g3 | *.ttf |
*.bak | *.gif | *.txz | |
*.baml | *.pea | *.GIF | *.udf |
*.bh | *.pgm | *.graffle | *.uvh |
*.bin | *.pic | *.gz | *.uvi |
*.bk | *.png | *.gzip | *.uvm |
*.bmp | *.PNG | *.h261 | *.uvp |
*.BMP | *.pnm | *.h263 | *.uvs |
*.btif | *.pot | *.h264 | *.uvu |
*.bz2 | *.potm | *.icns | *.viv |
*.bzip2 | *.potx | *.ico | *.vob |
*.cab | *.ppa | *.ief | *.war |
*.caf | *.ppam | *.img | *.wav |
*.cgm | *.ppm | *.ipa | *.wax |
*.class | *.pps | *.iso | *.wbmp |
*.cmx | *.ppsm | *.jar | *.wdp |
*.cpio | *.ppsx | *.jpeg | *.weba |
*.cr2 | *.ppt | *.JPEG | *.webm |
*.csv | *.pptm | *.jpg | *.webp |
*.cur | *.pptx | *.JPG | *.whl |
*.dat | *.psd | *.jpgv | *.wim |
*.dcm | *.pya | *.jpm | *.wm |
*.deb | *.pyc | *.jxr | *.wma |
*.dex | *.pyo | *.key | *.wmv |
*.djvu | *.pyv | *.ktx | *.wmx |
*.dll | *.qt | *.lha | *.woff |
*.dmg | *.rar | *.lib | *.woff2 |
*.dng | *.ras | *.lvp | *.wvx |
*.doc | *.raw | *.lz | *.xbm |
*.docm | *.resources | *.lzh | *.xif |
*.docx | *.rgb | *.lzma | *.xla |
*.dot | *.rip | *.lzo | *.xlam |
*.dotm | *.rlc | *.m3u | *.xls |
*.dra | *.rmf | *.m4a | *.xlsb |
*.DS_Store | *.rmvb | *.m4v | *.xlsm |
*.dsk | *.rtf | *.mar | *.xlsx |
*.dts | *.rz | *.mdi | *.xlt |
*.dtshd | *.s3m | *.mht | *.xltm |
*.dvb | *.s7z | *.mid | *.xltx |
*.dwg | *.scpt | *.midi | *.xm |
*.dxf | *.sgi | *.mj2 | *.xmind |
*.ecelp4800 | *.shar | *.mka | *.xpi |
*.mng | *.xz | *.mkv | *.xpm |
*.mobi | *.z | *.mmr | *.xwd |
*.mov | *.zip | *.movie | *.zipx |
*.mp3 |