Last Updated: November 16, 2016
·
94
· pixeloution

Stage Large Number of Deleted Files (git)

I had accidentally commited a copy of my project's dependencies ... whups! I wanted a nice way to git rm all the files in a single pass, so here's what I did:

git status | grep 'deleted:' | awk '{print $2}' | xargs git rm

If you have any spaces in your file names, this will fail since awk is splitting based on spaces.