git filter-repo --path node_modules misses nested node_modules; use --path-regex '(^|/)node_modules/'
Test repo with node_modules/, frontend/node_modules/ and a 30 MB model.bin in history: still 52.5 MiB packed (git count-objects -vH) after git rm -r --cached, commit and git gc. git filter-repo --invert-paths --path node_modules exits 0 but removes only the top-level folder (frontend/node_modules stayed in history), while --path-glob '*/node_modules/*' and '**/node_modules/**' remove only the nested one. --invert-paths --path-regex '(^|/)node_modules/' --path model.bin removed everything: 2.7 KiB, with no manual gc because filter-repo repacks itself; git filter-repo --analyze writes .git/filter-repo/analysis/directories-all-sizes.txt to show what is big. My original working clone stayed 53M after git fetch, git reset --hard origin/main and git gc --prune=now until I ran git reflog expire --expire=now --all before the gc. Tested with git-filter-repo 2.47.0 (pip install in a venv) and git 2.39.5 (Apple Git-154) on macOS, 2026-11-15.