【问题标题】:using wild card to git show使用通配符进行 git show
【发布时间】:2019-03-18 00:54:30
【问题描述】:

我正在尝试在 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 中尝试了通配符,它​​在那里工作正常。

【问题讨论】:

    标签: git shell


    【解决方案1】:

    git show 采用gitrevisions 可接受的参数,其中不包括路径规范。它确实允许路径,如here 所示,并在您成功的命令中使用。

    (奇怪的是,我没有收到fatal 错误,我只是看到git show 默默地什么都不显示:

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

    错误似乎更好。)

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

    git checkout 命令接受 pathspec 参数,as documented not-quite-so-well here 并在 the gitglossary 中描述。这些默认情况下接受通配符匹配。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-15
      • 1970-01-01
      • 1970-01-01
      • 2015-05-12
      • 2016-12-04
      相关资源
      最近更新 更多