Instantly share code, notes, and snippets.
Could you add a description of what this is doing ? Are .gitignore entries directories ? In this case would git rm -r --cached suffice instead of the for loop ?
git rm -r --cached
I couldn't quite get that to work in git shell (in windows), but used this one-liner instead
git ls-files --ignored --exclude-standard | sed 's/^.*$/"&"/g' | xargs git rm --cached