I have a project of an SNMP agent where the related MIB files (*.smiv2 files) were developed along with it, but now I want them in a separate git repository.
In orde
An -I switch can also be used.
some command | xargs -I % rm %
Full Answer, for future reference
git filter-branch --prune-empty --index-filter 'git ls-files | \
grep -v ".smiv2$" | xargs git rm --cached --ignore-unmatch DoesNotExistInMyProject'
The simplest solution would be to add a dummy argument to git rm
so that it always has at least one file parameter.
E.g.
... | xargs git rm --cached --ignore-unmatch DoesNotExistInMyProject
xargs
's -r
|--no-run-if-empty
flag might be cleaner:
... | xargs
--no-run-if-empty
git rm --cached --ignore-unmatched