Skip to content

Instantly share code, notes, and snippets.

@outsidecontext
Created January 11, 2018 11:42
Show Gist options
  • Select an option

  • Save outsidecontext/cb7db6b1a2050805a85512f9c428ac5a to your computer and use it in GitHub Desktop.

Select an option

Save outsidecontext/cb7db6b1a2050805a85512f9c428ac5a to your computer and use it in GitHub Desktop.
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