I see this command listed on the Git LFS website and documentation:
git lfs track "*.psd"
I have several file types in my project that I want to track with LFS, and will want to track all these same file types in future projects. I would like to be able to paste a single command to track all these extensions, is this possible?
After some experimentation I found this was doable by providing multiple arguments:
git lfs track "*.jpg" "*.png"
This will track both jpg files and png files
I figured out a trick that allows you to store the trackings in a file, which is way easier to manage for bigger projects.
Step 1: Create a text file a list of your trackings, like this:
"*.jpg"
"*.png"
I named mine .gitlfstracks
Step 2: Bulk import trackings from that list file, like this:
cat .gitlfstracks | xargs git lfs track
cat - prints a file to screen
| - redirects the output to another application
xargs - Runs a command over each line of an input
git lfs track - The standard command to track a file
Here is my current list, fyi: https://gist.github.com/bdombro/a1883d8a2cd0938ef798147ba66ecc00