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?
In git lfs terms, 'smudge' is the process of getting the actual data for the pointers that are stored locally. By installing git lfs with the --skip-smudge option, you are setting the filter smudge = git-lfs smudge --skip -- %f in the global . gitconfig file in your home directory.
You should use Git LFS if you have large files or binary files to store in Git repositories. That's because Git is decentralized. So, every developer has the full change history on their computer.
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
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