Skip to content

Instantly share code, notes, and snippets.

@micahwalter
Created February 21, 2017 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micahwalter/8cf2548c0bc79130a75f9ac21654db51 to your computer and use it in GitHub Desktop.
Save micahwalter/8cf2548c0bc79130a75f9ac21654db51 to your computer and use it in GitHub Desktop.
git filter-branch --prune-empty --tree-filter '
git lfs track "*.csv"
git add .gitattributes .gitconfig
for file in $(git ls-files | xargs git check-attr filter | grep "filter: lfs" | sed -r "s/(.*): filter: lfs/\1/"); do
echo "Processing ${file}"
git rm -f --cached ${file}
echo "Adding $file lfs style"
git add ${file}
done' --tag-name-filter cat -- --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment