LinuxCommandLibrary

git-hash-object

TLDR

Compute object hash

$ git hash-object [file]
copy
Compute and store object
$ git hash-object -w [file]
copy
Hash from stdin
$ echo "[content]" | git hash-object --stdin
copy
Specify object type
$ git hash-object -t [blob] [file]
copy

SYNOPSIS

git hash-object [options] [file...]

DESCRIPTION

git hash-object computes the object ID and optionally creates a blob from a file. A low-level command for interacting with the object database.

PARAMETERS

-w

Write object to database.
--stdin
Read from stdin.
-t type
Object type (blob, commit, tree, tag).
--path path
Hash as if at path.
--no-filters
Don't apply filters.

SEE ALSO

Copied to clipboard