Bryan Larsen | 7672db2 | 2005-07-08 16:51:55 -0700 | [diff] [blame] | 1 | git-hash-object(1) |
| 2 | ================== |
Bryan Larsen | 7672db2 | 2005-07-08 16:51:55 -0700 | [diff] [blame] | 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | c3f0baa | 2007-01-18 15:53:37 -0800 | [diff] [blame] | 6 | git-hash-object - Compute object ID and optionally creates a blob from a file |
Bryan Larsen | 7672db2 | 2005-07-08 16:51:55 -0700 | [diff] [blame] | 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Dmitry Potapov | 9ae8e00 | 2008-08-03 18:36:19 +0400 | [diff] [blame] | 11 | [verse] |
Eric Sunshine | 83115ac | 2015-05-04 03:25:13 -0400 | [diff] [blame] | 12 | 'git hash-object' [-t <type>] [-w] [--path=<file>|--no-filters] [--stdin [--literally]] [--] <file>... |
Junio C Hamano | 33e8fc8 | 2015-10-16 11:27:42 -0700 | [diff] [blame] | 13 | 'git hash-object' [-t <type>] [-w] --stdin-paths [--no-filters] |
Bryan Larsen | 7672db2 | 2005-07-08 16:51:55 -0700 | [diff] [blame] | 14 | |
| 15 | DESCRIPTION |
| 16 | ----------- |
| 17 | Computes the object ID value for an object with specified type |
| 18 | with the contents of the named file (which can be outside of the |
| 19 | work tree), and optionally writes the resulting object into the |
| 20 | object database. Reports its object ID to its standard output. |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 21 | This is used by 'git cvsimport' to update the index |
Bryan Larsen | 7672db2 | 2005-07-08 16:51:55 -0700 | [diff] [blame] | 22 | without modifying files in the work tree. When <type> is not |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 23 | specified, it defaults to "blob". |
Bryan Larsen | 7672db2 | 2005-07-08 16:51:55 -0700 | [diff] [blame] | 24 | |
Johannes Schindelin | 2c6e477 | 2005-08-05 17:05:02 +0200 | [diff] [blame] | 25 | OPTIONS |
| 26 | ------- |
| 27 | |
| 28 | -t <type>:: |
| 29 | Specify the type (default: "blob"). |
| 30 | |
| 31 | -w:: |
| 32 | Actually write the object into the object database. |
Bryan Larsen | 7672db2 | 2005-07-08 16:51:55 -0700 | [diff] [blame] | 33 | |
Daniel Barkalow | 024510c | 2005-12-10 17:25:24 -0500 | [diff] [blame] | 34 | --stdin:: |
| 35 | Read the object from standard input instead of from a file. |
| 36 | |
Adam Roben | d8ee483 | 2008-05-23 16:19:38 +0200 | [diff] [blame] | 37 | --stdin-paths:: |
Junio C Hamano | 33e8fc8 | 2015-10-16 11:27:42 -0700 | [diff] [blame] | 38 | Read file names from the standard input, one per line, instead |
| 39 | of from the command-line. |
Adam Roben | d8ee483 | 2008-05-23 16:19:38 +0200 | [diff] [blame] | 40 | |
Dmitry Potapov | 3970243 | 2008-08-03 18:36:21 +0400 | [diff] [blame] | 41 | --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 Ackermann | 2de9b71 | 2013-01-21 20:17:53 +0100 | [diff] [blame] | 44 | used to determine what Git filters should be applied to the object |
Dmitry Potapov | 3970243 | 2008-08-03 18:36:21 +0400 | [diff] [blame] | 45 | 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 Potapov | 4a3d85d | 2008-08-03 18:36:22 +0400 | [diff] [blame] | 51 | --no-filters:: |
| 52 | Hash the contents as is, ignoring any input filter that would |
Ville Skyttä | 6b677a2 | 2010-07-20 00:17:17 +0300 | [diff] [blame] | 53 | have been chosen by the attributes mechanism, including the end-of-line |
Dmitry Potapov | 4a3d85d | 2008-08-03 18:36:22 +0400 | [diff] [blame] | 54 | conversion. If the file is read from standard input then this |
Eric Sunshine | 83115ac | 2015-05-04 03:25:13 -0400 | [diff] [blame] | 55 | 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 Potapov | 4a3d85d | 2008-08-03 18:36:22 +0400 | [diff] [blame] | 62 | |
Bryan Larsen | 7672db2 | 2005-07-08 16:51:55 -0700 | [diff] [blame] | 63 | GIT |
| 64 | --- |
Christian Couder | 9e1f0a8 | 2008-06-06 09:07:32 +0200 | [diff] [blame] | 65 | Part of the linkgit:git[1] suite |