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/*
Git LFS objects can be large in size. By default, they are stored on the server GitLab is installed on.
DESCRIPTION. Deletes local copies of LFS files which are old, thus freeing up disk space. Prune operates by enumerating all the locally stored objects, and then deleting any which are not referenced by at least ONE of the following: ○ the current checkout.
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.
This way you can track any folders with any subfolder. You want to recursively track folders with "n" number of folder and "m" number of sub-folders. I would recommend doing it this way.
find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort -u
find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort -u | awk '{print $1" filter=lfs diff=lfs merge=lfs -text"}' | sed 's/^/*./'
It works for
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With