mattalxndr
mattalxndr

Reputation: 9418

Is there a git command that will output the contents of a file as it is in the index?

Is there a git command that will output the contents of a file as it is in the index? In other words, the other file used in git diff.

Upvotes: 0

Views: 65

Answers (1)

jimw
jimw

Reputation: 2598

You want:

git show :<filename>

See the entry on <rev>:<path> under Specifying Revisions in the gitrevisions man page.

Upvotes: 3

Related Questions