Created
December 6, 2019 23:05
-
-
Save paulscott/95ddc42ba433ed5d183a57cce630d74f to your computer and use it in GitHub Desktop.
A script to find files that aren't under git-lfs, but should be
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" != "1" ]; then | |
echo "$0 requires a size argument. ex: 100k." | |
exit 1 | |
fi | |
sizeParam="+${1}" | |
filesOverSize=$( find . -size ${sizeParam} | grep -v /.git | sed 's/^.\///g' ) | |
notInLFS=$({ git ls-files && git lfs ls-files | cut -d' ' -f3-; } | sort | uniq -u ) | |
largeNotInLFS=$({ echo "$filesOverSize" && echo "$notInLFS" ; } | sort | uniq -d ) | |
largeNotInLFSAndNotIgnored=$(echo "$largeNotInLFS" | git check-ignore --stdin --verbose -n | cut -f 2 ) | |
echo "$largeNotInLFSAndNotIgnored" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment