从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.
更多推荐
发布评论