试图理解这一点:
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