Reputation: 7685
Trying to understand this:
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
Why does git show not display the blob and also not give an error?
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)
>
for comparison
> 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.
Update:
the first answer below works:
git show HEAD:yourfile
Is there a way to specify wildcards in the show command so that I can show the file without a full (and possibly long) path?
Upvotes: 1
Views: 44
Reputation: 123690
git show yourfile
is equivalent to git show HEAD -- yourfile
and will try to find the changes to the file in the current commit. If the file was not modified in that commit, nothing will be shown.
To instead show the content of a file as it was at a given revision:
git show HEAD:yourfile
Upvotes: 5