How to get SHA of file for specific Git commit?

Viewed 1835

Is there a way to get SHA of file for specific Git commit?

It's possible with 2 commands:

  1. retrieving file git show COMMIT_VERSION:myfile.txt > ~/tmp/myfile.txt
  2. calculating SHA git hash-object ./tmp/myfile.txt

But, maybe there's specific command in Git that does exactly that?

1 Answers
Related