使用通配符git显示

时间:2019-03-18 00:54:31

标签: git shell

我正尝试在git show中使用通配符,如下所示。

git show h3223459:./data/path/to/fullfile.csv

以上命令有效。但是,当我尝试使用通配符时,会引发错误消息。

git show h3223459:./data/path/to/*file.csv

fatal: Path 'data/path/to/*file.csv' does not exist in 'h3223459'

有什么办法可以在git show中传递通配符。我在git checkout中尝试了通配符,并且在那很好用。

1 个答案:

答案 0 :(得分:0)

git show接受gitrevisions可接受的参数,其中不包含路径规范。它确实允许使用路径,如here以及成功命令中所使用的。

(奇怪的是,我没有收到fatal错误,我只是看到git show默默无语:

$ git show 'b5101f929789889c2e536d915698f58d5c5c6b7a:*kefile'
$ git show 'b5101f929789889c2e536d915698f58d5c5c6b7a:./*kefile'

错误似乎更好。)

  

我在git checkout中尝试了通配符...

git checkout命令接受as documented not-quite-so-well here并在the gitglossary中进行了描述的 pathspec 参数。默认情况下,它们确实接受通配符匹配。