So, it has been an interesting journey, but time to remove git-lfs. Here follows a summary of the approach I used to safely remove git-lfs,
git add --update; git commit -m “Commit before lfs removal”; git push
git checkout -b “remove-lfs”
- remove hooks
git lfs uninstall
- remove files enrolled in git-lfs from .gitattributes (open the file, delete the contents) [P.S. don’t delete the file!]
- list all lfs files,
git lfs ls-files
- run
git rm --cached
for each filegit lfs ls-files | cut -f 3 -d ' ' | xargs git rm --cached
- Untrack files (individually or pattern)
git lfs untrack '*.xz'