Skip to content

Instantly share code, notes, and snippets.

@midaslefkowitz
midaslefkowitz / remove-lfs.sh
Created March 19, 2023 11:07
Completely remove all lfs files from your git repo. WARNING - this will rewrite your git history
#!/bin/zsh
git lfs install
git lfs fetch --all
git lfs checkout
lfs_dirs=()
echo "finding lfs files"
for lfs_file in $(git lfs ls-files | sed -r 's/^.{13}//'); do lfs_dirs+=($(dirname "$lfs_file")); done;