Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
特定のGitコミット用にファイルのSHAを取得する方法はありますか?
それは2つのコマンドで可能です:
git show COMMIT_VERSION:myfile.txt > ~/tmp/myfile.txt
git hash-object ./tmp/myfile.txt
しかし、Gitにはまさにそれを行う特定のコマンドがあるのでしょうか?
git ls-tree COMMIT_VERSION myfile.txt3番目のフィールドに同じ結果が含まれているようです。
git ls-tree COMMIT_VERSION myfile.txt