blob: df9e2c58bdbc5f31edaf25577df744868e16f3de [file] [log] [blame]
Bryan Larsen7672db22005-07-08 16:51:55 -07001git-hash-object(1)
2==================
Bryan Larsen7672db22005-07-08 16:51:55 -07003
4NAME
5----
Junio C Hamanoc3f0baa2007-01-18 15:53:37 -08006git-hash-object - Compute object ID and optionally creates a blob from a file
Bryan Larsen7672db22005-07-08 16:51:55 -07007
8
9SYNOPSIS
10--------
Dmitry Potapov9ae8e002008-08-03 18:36:19 +040011[verse]
Eric Sunshine83115ac2015-05-04 03:25:13 -040012'git hash-object' [-t <type>] [-w] [--path=<file>|--no-filters] [--stdin [--literally]] [--] <file>...
Junio C Hamano33e8fc82015-10-16 11:27:42 -070013'git hash-object' [-t <type>] [-w] --stdin-paths [--no-filters]
Bryan Larsen7672db22005-07-08 16:51:55 -070014
15DESCRIPTION
16-----------
17Computes the object ID value for an object with specified type
18with the contents of the named file (which can be outside of the
19work tree), and optionally writes the resulting object into the
20object database. Reports its object ID to its standard output.
Ævar Arnfjörð Bjarmasonafc3bf62019-05-20 23:53:10 +020021When <type> is not specified, it defaults to "blob".
Bryan Larsen7672db22005-07-08 16:51:55 -070022
Johannes Schindelin2c6e4772005-08-05 17:05:02 +020023OPTIONS
24-------
25
26-t <type>::
27 Specify the type (default: "blob").
28
29-w::
30 Actually write the object into the object database.
Bryan Larsen7672db22005-07-08 16:51:55 -070031
Daniel Barkalow024510c2005-12-10 17:25:24 -050032--stdin::
33 Read the object from standard input instead of from a file.
34
Adam Robend8ee4832008-05-23 16:19:38 +020035--stdin-paths::
Junio C Hamano33e8fc82015-10-16 11:27:42 -070036 Read file names from the standard input, one per line, instead
37 of from the command-line.
Adam Robend8ee4832008-05-23 16:19:38 +020038
Dmitry Potapov39702432008-08-03 18:36:21 +040039--path::
40 Hash object as it were located at the given path. The location of
41 file does not directly influence on the hash value, but path is
Thomas Ackermann2de9b712013-01-21 20:17:53 +010042 used to determine what Git filters should be applied to the object
Dmitry Potapov39702432008-08-03 18:36:21 +040043 before it can be placed to the object database, and, as result of
44 applying filters, the actual blob put into the object database may
45 differ from the given file. This option is mainly useful for hashing
46 temporary files located outside of the working directory or files
47 read from stdin.
48
Dmitry Potapov4a3d85d2008-08-03 18:36:22 +040049--no-filters::
50 Hash the contents as is, ignoring any input filter that would
Ville Skyttä6b677a22010-07-20 00:17:17 +030051 have been chosen by the attributes mechanism, including the end-of-line
Dmitry Potapov4a3d85d2008-08-03 18:36:22 +040052 conversion. If the file is read from standard input then this
Eric Sunshine83115ac2015-05-04 03:25:13 -040053 is always implied, unless the `--path` option is given.
54
55--literally::
56 Allow `--stdin` to hash any garbage into a loose object which might not
57 otherwise pass standard object parsing or git-fsck checks. Useful for
58 stress-testing Git itself or reproducing characteristics of corrupt or
59 bogus objects encountered in the wild.
Dmitry Potapov4a3d85d2008-08-03 18:36:22 +040060
Bryan Larsen7672db22005-07-08 16:51:55 -070061GIT
62---
Christian Couder9e1f0a82008-06-06 09:07:32 +020063Part of the linkgit:git[1] suite