从git diff

编程入门 行业动态 更新时间:2024-10-28 22:23:56
git diff-tree中排除文件(Exclude files from git diff-tree)

我执行命令:

git diff-tree --diff-filter=ACMR --no-commit-id --name-only -r $COMMIT^1.. --

从结果我创建zip存档。

如何从上述命令生成的结果中排除特定文件?

I execute command:

git diff-tree --diff-filter=ACMR --no-commit-id --name-only -r $COMMIT^1.. --

from the result I create zip archive.

How can I exclude specific files from the result generated by the above command ?

最满意答案

除非您可以在--之后明确指定您感兴趣的路径,否则我不确定您是否可以使用diff-tree为您执行此操作。

但您可以使用grep / sed / awk / etc对该列表进行后处理。 至少。

实际上,你也许可以使用zip的-x参数直接在压缩步骤中为你做排除。

I'm not sure you can get diff-tree to do that for you unless you can specify paths that you are interested in explicitly after the --.

But you can post-process that list with grep/sed/awk/etc. at the very least.

Actually, you might be able to use zip's -x argument to do the exclusions for you directly in the zipping step as well.

更多推荐

本文发布于:2023-07-15 21:49:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1119273.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:git   diff

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!