CharlieC3
10/28/2016 - 7:34 PM

Convert git repo to use git lfs

Convert git repo to use git lfs

#!/bin/bash

# May not always work. In that case use convert_repo_to_lfs
bfg --convert-to-git-lfs '*.fla' --no-blob-protection
#!/bin/bash

# Try convert_repo_to_lfs_bfg.sh first
git filter-branch --prune-empty --tree-filter '
git lfs track "*.fla"
git lfs track "*.mov"

git add .gitattributes

git ls-files -z | xargs -0 git check-attr filter | grep "filter: lfs" | sed -E "s/(.*): filter: lfs/\1/" | tr "\n" "\0" | while read -r -d $'"'\0'"' file; do
    echo "Processing ${file}"

    git rm -f --cached "${file}"
    echo "Adding $file lfs style"
    git add -f "${file}"
done

' --tag-name-filter cat -- --all