Skip to content

Instantly share code, notes, and snippets.

@mvidaldp
Created January 10, 2021 17:03
Show Gist options
  • Save mvidaldp/ac530e32e4cb26c29bd92d27e2f31ae1 to your computer and use it in GitHub Desktop.
Save mvidaldp/ac530e32e4cb26c29bd92d27e2f31ae1 to your computer and use it in GitHub Desktop.
Tell git lfs to track multiple files (bigger than 50MB) from a list of files
#!/bin/bash
# assuming you are on your git repo folder and you generated a large file list (bigger than 50MB in this case), e.g.:
# find . -size +50M | cat >> file-list.txt
flist="file-list.txt"
while IFS= read -r file
do
git lfs track "$file"
done < "$flist"
# do not forget to run `git add .gitattributes` afterwards, before you add and commit the large files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment