git/hash-object

Compute Object ID

Compute object ID and optionally create a blob from a file

git
hash
object

Command

git hash-object

Explanation

git hash-object is used to compute the object ID and optionally create a blob from a file. It computes the object ID and optionally creates a blob from the file.

Examples

Compute hash for file

git hash-object file.txt