繁体   English   中英

Git秀 <commit> 并获取文件子集的差异

[英]Git show <commit> and get diff for a file subset

我正在寻找一种解决方案,以使用git show <commit>命令获得不同的提交。

通常我会做:

$> git show 12f00d

和预期的一样,我得到了在给定提交中修改的所有文件的所有差异。

现在,在重构之后,我有一个很大的提交(许多文件已更改/移动),而我只需要知道此提交中所有xml文件中递归更改的内容。 我有很多.java,.xsl,.properties文件,只有几个.xml文件。

我尝试了以下命令,但未成功:

$> git show 12f00d -L 0,0:*.xml 
    > incorrect syntax

$> git show 12f00d *.xml 
    > no result

$> git show 12f00d **/*.xml 
    > Return the root pom.xml but not recursively

$> git show 12f00d **/**.xml 
    > Return the root pom.xml but not recursively

$> git show 12f00d -- *.xml 
    > no result

$> git show 12f00d -- **/*.xml 
    > Return the root pom.xml but not recursively

$> git show 12f00d -- **/**.xml 
    > Return the root pom.xml but not recursively

我用命令git diff <commit>尝试了相同的选项。

我在Linux CentOS(bash终端)下使用Git版本1.8.4。

您知道git是否可以使用这种过滤器(也许是另一个命令)

试试这个: git show 12f00d '*.xml'

暂无
暂无

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

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