Add commonly used binaries to git LFS

Platform Notice: Cloud Only - This article only 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 extensions listed 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.

Updated on May 22, 2025

Still need help?

The Atlassian Community is here for you.