Last active
February 28, 2019 07:42
-
-
Save karlhorky/9119641f911eb52a6f26 to your computer and use it in GitHub Desktop.
Migrate existing design git repo to large file storage with history
This file contains 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
git filter-branch --prune-empty --tree-filter ' | |
git lfs track "*.ai" | |
git lfs track "*.psd" | |
git lfs track "*.eps" | |
git lfs track "*.jpg" | |
git lfs track "*.png" | |
git lfs track "*.svg" | |
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 "${file}" | |
done | |
' --tag-name-filter cat -- --all |
Any way you can limit this to a specific branch ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From git-lfs/git-lfs#326 (comment)