git-hash-object
Compute the unique hash key of content and optionally create an object with specified type. tldr-pages
On several platforms
Several platforms
Compute the object ID without storing it
git hash-object path/to/fileIdentifyCompute the object ID and store it in the Git database
git hash-object -w path/to/fileIdentifyCompute the object ID specifying the object type
git hash-object -t blob path/to/fileIdentifyCompute the object ID from stdin
cat path/to/file | git hash-object --stdinIdentify