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.
Written by Erik Wurzer
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
##git
Authors
Related Tags
##git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#