threads / discuss / 18769

Showing the version of a file that's in the Index.

Subject: Showing the version of a file that's in the Index.

## tl;dr

7 messages between Apr 7, 2009 and Apr 8, 2009.

replies: 6people: 4as markdown or json

Tim Visher· Apr 7, 2009, 19:59 UTC · lore
Hello Everyone,

How do you go about showing the version of the file that's in an index. I'm currently going through a somewhat convoluted in-file add/commit process and I'd like to verify that what I'm about to commit is in fact the version that I want to commit.

Thanks in advance!
-- 
In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail
Markus Heidelberg· Apr 7, 2009, 20:10 UTC · re: Tim Visher · lore

Re: Showing the version of a file that's in the Index.

Tim Visher, 07.04.2009:
> How do you go about showing the version of the file that's in an
> index.
With version do you mean content? Then
    git cat-file -p :0:file
or
    git cat-file -p :file
See git-rev-parse(1) "Specifying revisions", the last item.
Markus
Teemu Likonen· Apr 7, 2009, 20:14 UTC · re: Markus Heidelberg · lore

Re: Showing the version of a file that's in the Index.

On 2009-04-07 22:10 (+0200), Markus Heidelberg wrote:
Show 9 quoted lines
> Tim Visher, 07.04.2009:
>> How do you go about showing the version of the file that's in an
>> index.
>
> With version do you mean content? Then
>
>     git cat-file -p :0:file
> or
>     git cat-file -p :file
Or
    git show :file
Tim Visher· Apr 7, 2009, 20:15 UTC · re: Teemu Likonen · lore

Re: Showing the version of a file that's in the Index.

On Tue, Apr 7, 2009 at 4:14 PM, Teemu Likonen <tlikonen@iki.fi> wrote:
Show 16 quoted lines
> On 2009-04-07 22:10 (+0200), Markus Heidelberg wrote:
>
>> Tim Visher, 07.04.2009:
>>> How do you go about showing the version of the file that's in an
>>> index.
>>
>> With version do you mean content? Then
>>
>>     git cat-file -p :0:file
>> or
>>     git cat-file -p :file
>
> Or
>
>    git show :file
>
Nice.  Thank you!
-- 
In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail
Markus Heidelberg· Apr 7, 2009, 21:57 UTC · re: Teemu Likonen · lore

Re: Showing the version of a file that's in the Index.

Teemu Likonen, 07.04.2009:
> Or
> 
>     git show :file

Huh, I use git-show daily for commits, but I completely forgot about it for files when replying. I already felt strange about having to pass an option.

Teemu Likonen· Apr 8, 2009, 05:00 UTC · re: Markus Heidelberg · lore

Re: Showing the version of a file that's in the Index.

On 2009-04-07 23:57 (+0200), Markus Heidelberg wrote:
Show 7 quoted lines
> Teemu Likonen, 07.04.2009:
>> Or
>> 
>>     git show :file
>
> Huh, I use git-show daily for commits, but I completely forgot about it
> for files when replying.
It's nice for trees too:
    git show HEAD~3:
    git show master~1:directory/
Johannes Schindelin· Apr 8, 2009, 11:04 UTC · re: Teemu Likonen · lore

Re: Showing the version of a file that's in the Index.

Hi,
On Wed, 8 Apr 2009, Teemu Likonen wrote:
Show 14 quoted lines
> On 2009-04-07 23:57 (+0200), Markus Heidelberg wrote:
> 
> > Teemu Likonen, 07.04.2009:
> >> Or
> >> 
> >>     git show :file
> >
> > Huh, I use git-show daily for commits, but I completely forgot about it
> > for files when replying.
> 
> It's nice for trees too:
> 
>     git show HEAD~3:
>     git show master~1:directory/

But that's not in the index, and my patch to show cache-trees was rejected.

Ciao, Dscho

← back to recent threads