繁体   English   中英

将git status的结果传递给后续命令

[英]Piping the Results of git status to Subsequent Commands

我的Git存储库中有大量活动文件。 我所做的一项更改是删除多个目录中的大量图像。 我想立即提交更改,但我不想包含所有活动文件,也不想为每个图像手动键入git rm myfile.png

因此,基本上我想做的是在所有以.png结尾的活动文件上运行git rm 我正在尝试通过将git status的结果传递到git rm来实现此目的,但是我无法隔离文件名并使它按我的意愿工作。

这是对管道的正确使用吗?如果需要,我需要什么语法?

任何帮助表示赞赏,谢谢。

如果已经删除了文件,则可以键入:

git add -u

并且它们将从git存储库中删除。

git help add

-u, --update
           Only match <filepattern> against already tracked files in the index
           rather than the working tree. That means that it will never stage
           new files, but that it will stage modified new contents of tracked
           files and that it will remove files from the index if the
           corresponding files in the working tree have been removed.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM