Skip to content

Instantly share code, notes, and snippets.

@gvJaime
Created June 4, 2018 17:19
Show Gist options
  • Save gvJaime/893953a990b0dd93c13af485cdb3a3ce to your computer and use it in GitHub Desktop.
Save gvJaime/893953a990b0dd93c13af485cdb3a3ce to your computer and use it in GitHub Desktop.
REMOVE GIT LFS
git filter-branch -f --prune-empty --tree-filter '
if [ -f .gitattributes ]; then
git rm -f .gitattributes
fi
find * -type f | while read FILE; do
while head -2 "$FILE" | grep -q "^oid sha256"; do
ref=$(cat "$FILE")
echo -n "$ref" | git lfs smudge > "$FILE"
git add "$FILE"
done
done' --tag-name-filter cat -- --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment