git show 命令没有产生任何结果

git show command yields no results

试图理解这一点:

PS C:\Users\BRITTG2\source\repos\tbsm.canoe.core (feature/bau-1057)
> git ls-files | sls Filtered

Projects/TBSM.Canoe.Core/TBSM.Canoe.Core.Common/TBSM.Canoe.Core.Common.Domain/Certificates/FilteredCertificates.cs

为什么 git show 不显示 blob 也不报错?

PS C:\Users\BRITTG2\source\repos\tbsm.canoe.core (feature/bau-1057)
> git show Projects/TBSM.Canoe.Core/TBSM.Canoe.Core.Common/TBSM.Canoe.Core.Common.Domain/Certificates/FilteredCertificates.cs

PS C:\Users\BRITTG2\source\repos\tbsm.canoe.core (feature/bau-1057)
>

比较

    > cat Projects/TBSM.Canoe.Core/TBSM.Canoe.Core.Common/TBSM.Canoe.Core.Common.Domain/Certificates/FilteredCertificates.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
etc.

更新:

下面的第一个答案有效:

git show HEAD:yourfile

有没有办法在 show 命令中指定通配符,这样我就可以在没有完整(可能很长)路径的情况下显示文件?

git show yourfile 等同于 git show HEAD -- yourfile 并且将尝试在当前提交中查找对文件的更改。如果文件在该提交中未被修改,则不会显示任何内容。

要改为显示给定修订版的文件内容:

git show HEAD:yourfile