Git LFS track folder recursively

csa picture csa · Mar 3, 2016 · Viewed 33.9k times · Source

Is it possible to track recursively all files contained in a folder and its subfolders with Git LFS ?

I would like to do something like this :

git lfs track myfolder/*

Answer

sschuberth picture sschuberth · Mar 3, 2016

Use git lfs track "myfolder/**", with quotes to avoid the shell already expanding the pattern. All that the track command does is to write to .gitattributes, which in turn uses (almost) the same pattern matching rules as .gitignore, see the PATTERN FORMAT description.