Reputation: 14185
I try to remove deleted files from git:
git rm `git status | grep deleted | awk '{print $3}'`
But got error in mac bash:
-bash: /usr/local/git/bin/git: Argument list too long
If I run ...
git status | grep deleted | awk '{print $3}'
... I successfully got list of files to be deleted. But how to delete them from git?
Upvotes: 1
Views: 3477
Reputation: 799150
xargs
will limit the command length to something the shell won't choke on and invoke the command passed as many times as required.
git status | grep deleted | awk '{print $3}' | xargs git rm
Upvotes: 7