-
-
Save thexa4/d2ce19af16b7ebbd81f9b1cddce3756c 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 "*.bsp" | |
git lfs track "*.vtf" | |
git lfs track "*.wav" | |
git lfs track "*.mp3" | |
git lfs track "*.mdl" | |
git lfs track "*.vtx" | |
git lfs track "*.vvd" | |
git lfs track "*.phy" | |
git lfs track "*.bik" | |
git lfs track "*.tga" | |
git lfs track "*.otf" | |
git lfs track "*.ttf" | |
git lfs track "*.pcf" | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment