Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我尝试从 git 中删除已删除的文件:
git rm `git status | grep deleted | awk '{print $3}'`
但是在mac bash中出现错误:
-bash: /usr/local/git/bin/git: Argument list too long
如果我跑...
git status | grep deleted | awk '{print $3}'
...我成功获得了要删除的文件列表。但是如何从 git 中删除它们呢?
xargs会将命令长度限制为外壳不会阻塞的内容,并根据需要多次调用传递的命令。
xargs
git status | grep deleted | awk '{print $3}' | xargs git rm