gpt4 book ai didi

git - 使用文件扩展名过滤 `git show ` 结果

转载 作者:行者123 更新时间:2023-12-04 12:18:25 31 4
gpt4 key购买 nike

考虑一个非常大的变更集。在做 git show <sha1> ,您将获得与所有文件相关的更改。但我只对 .cpp 所做的更改感兴趣文件,其余文件对我的分析没有用。

如何从 git show 中过滤掉它们结果?

任何命令或选项。

最佳答案

@ElipieKay 在评论部分给出的答案对我有用。

打印具有 .cpp 扩展名的文件名。

git show --name-status 29a9f891fd -- *.cpp      

显示对扩展名为 .cpp 的文件所做的更改。
git show 29a9f891fd -- *.cpp

关于git - 使用文件扩展名过滤 `git show <commitId>` 结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44093677/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com