git remove folder form past all commits

Shell
git filter-branch --tree-filter 'rm -rf node_modules' --prune-empty HEAD

Source

Also in Shell: