Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-hash-object(1) |
| 2 | ================== |
| 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | 7c73c66 | 2007-01-19 00:37:50 | [diff] [blame] | 6 | git-hash-object - Compute object ID and optionally creates a blob from a file |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Junio C Hamano | 5cf43ca | 2008-08-20 09:14:14 | [diff] [blame] | 11 | [verse] |
| 12 | 'git hash-object' [-t <type>] [-w] [--path=<file>|--no-filters] [--stdin] [--] <file>... |
Junio C Hamano | 118896b | 2010-03-07 09:10:12 | [diff] [blame] | 13 | 'git hash-object' [-t <type>] [-w] --stdin-paths [--no-filters] < <list-of-paths> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [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. |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 21 | This is used by 'git cvsimport' to update the index |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 22 | without modifying files in the work tree. When <type> is not |
Junio C Hamano | a77a513 | 2007-06-08 16:13:44 | [diff] [blame] | 23 | specified, it defaults to "blob". |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 24 | |
| 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. |
| 33 | |
| 34 | --stdin:: |
| 35 | Read the object from standard input instead of from a file. |
| 36 | |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 37 | --stdin-paths:: |
| 38 | Read file names from stdin instead of from the command-line. |
| 39 | |
Junio C Hamano | 5cf43ca | 2008-08-20 09:14:14 | [diff] [blame] | 40 | --path:: |
| 41 | Hash object as it were located at the given path. The location of |
| 42 | file does not directly influence on the hash value, but path is |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 43 | used to determine what Git filters should be applied to the object |
Junio C Hamano | 5cf43ca | 2008-08-20 09:14:14 | [diff] [blame] | 44 | before it can be placed to the object database, and, as result of |
| 45 | applying filters, the actual blob put into the object database may |
| 46 | differ from the given file. This option is mainly useful for hashing |
| 47 | temporary files located outside of the working directory or files |
| 48 | read from stdin. |
| 49 | |
| 50 | --no-filters:: |
| 51 | Hash the contents as is, ignoring any input filter that would |
Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 52 | have been chosen by the attributes mechanism, including the end-of-line |
Junio C Hamano | 5cf43ca | 2008-08-20 09:14:14 | [diff] [blame] | 53 | conversion. If the file is read from standard input then this |
| 54 | is always implied, unless the --path option is given. |
| 55 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 56 | GIT |
| 57 | --- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 58 | Part of the linkgit:git[1] suite |