blob: 814e74406ae4fb6ac68213df1f7e8e0192d1dbaf [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.
Thomas Rast0b444cd2010-01-10 00:33:00 +010021This is used by 'git cvsimport' to update the index
Bryan Larsen7672db22005-07-08 16:51:55 -070022without modifying files in the work tree. When <type> is not
Junio C Hamanoa6080a02007-06-07 00:04:01 -070023specified, it defaults to "blob".
Bryan Larsen7672db22005-07-08 16:51:55 -070024
Johannes Schindelin2c6e4772005-08-05 17:05:02 +020025OPTIONS
26-------
27
28-t <type>::
29 Specify the type (default: "blob").
30
31-w::
32 Actually write the object into the object database.
Bryan Larsen7672db22005-07-08 16:51:55 -070033
Daniel Barkalow024510c2005-12-10 17:25:24 -050034--stdin::
35 Read the object from standard input instead of from a file.
36
Adam Robend8ee4832008-05-23 16:19:38 +020037--stdin-paths::
Junio C Hamano33e8fc82015-10-16 11:27:42 -070038 Read file names from the standard input, one per line, instead
39 of from the command-line.
Adam Robend8ee4832008-05-23 16:19:38 +020040
Dmitry Potapov39702432008-08-03 18:36:21 +040041--path::
42 Hash object as it were located at the given path. The location of
43 file does not directly influence on the hash value, but path is
Thomas Ackermann2de9b712013-01-21 20:17:53 +010044 used to determine what Git filters should be applied to the object
Dmitry Potapov39702432008-08-03 18:36:21 +040045 before it can be placed to the object database, and, as result of
46 applying filters, the actual blob put into the object database may
47 differ from the given file. This option is mainly useful for hashing
48 temporary files located outside of the working directory or files
49 read from stdin.
50
Dmitry Potapov4a3d85d2008-08-03 18:36:22 +040051--no-filters::
52 Hash the contents as is, ignoring any input filter that would
Ville Skyttä6b677a22010-07-20 00:17:17 +030053 have been chosen by the attributes mechanism, including the end-of-line
Dmitry Potapov4a3d85d2008-08-03 18:36:22 +040054 conversion. If the file is read from standard input then this
Eric Sunshine83115ac2015-05-04 03:25:13 -040055 is always implied, unless the `--path` option is given.
56
57--literally::
58 Allow `--stdin` to hash any garbage into a loose object which might not
59 otherwise pass standard object parsing or git-fsck checks. Useful for
60 stress-testing Git itself or reproducing characteristics of corrupt or
61 bogus objects encountered in the wild.
Dmitry Potapov4a3d85d2008-08-03 18:36:22 +040062
Bryan Larsen7672db22005-07-08 16:51:55 -070063GIT
64---
Christian Couder9e1f0a82008-06-06 09:07:32 +020065Part of the linkgit:git[1] suite