How can I show the contents of a file at a specific state of a git repo?

Posted by richcollins on Stack Overflow See other posts from Stack Overflow or by richcollins
Published on 2010-03-23T01:52:33Z Indexed on 2010/03/23 3:21 UTC
Read the original article Hit count: 223

Filed under:

I want to show the contents of a file given by a path at a specific state of a git repo. I unsuccessfully tried this:

git show f825334150cd4bc8f46656b2daa8fa1e92f7796d:Katana/source/Git/GitLocalBranch.h
fatal: ambiguous argument
'f825334150cd4bc8f46656b2daa8fa1e92f7796d:Katana/source/Git/GitLocalBranch.h': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions

The commit in question didn't modify the file specified. How can I show the contents of a file at a given state (specified by a commit hash) regardless of the involvement of the file in the commit?

© Stack Overflow or respective owner

Related posts about git