Created
September 6, 2017 20:15
-
-
Save Gnappuraz/aaeb897c16b3dfd748a0a158526af8e6 to your computer and use it in GitHub Desktop.
git remove old lfs files
This file contains hidden or 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 -c GIT_LFS_SKIP_SMUDGE=1 clone repo //clone a repo without downloading the files | |
| // list all tracked files with git lfs (png, wav, mp3 especially) | |
| // list for each file all the lfs versions | |
| // run git filter on each file to point to the most recent one | |
| git filter-branch --tree-filter 'sed -i "/old_pointer/new_pointer" filename' -- --all | |
| // run a git lfs prune to remove the files not referenced anymore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment