[英]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.