]>
Commit | Line | Data |
---|---|---|
7672db20 BL |
1 | git-hash-object(1) |
2 | ================== | |
7672db20 BL |
3 | |
4 | NAME | |
5 | ---- | |
d4f28279 | 6 | git-hash-object - Compute object ID and optionally create an object from a file |
7672db20 BL |
7 | |
8 | ||
9 | SYNOPSIS | |
10 | -------- | |
9ae8e008 | 11 | [verse] |
e2f4e7e8 | 12 | 'git hash-object' [-t <type>] [-w] [--path=<file> | --no-filters] |
5af8b61c | 13 | [--stdin [--literally]] [--] <file>... |
33e8fc87 | 14 | 'git hash-object' [-t <type>] [-w] --stdin-paths [--no-filters] |
7672db20 BL |
15 | |
16 | DESCRIPTION | |
17 | ----------- | |
18 | Computes the object ID value for an object with specified type | |
19 | with the contents of the named file (which can be outside of the | |
20 | work tree), and optionally writes the resulting object into the | |
21 | object database. Reports its object ID to its standard output. | |
afc3bf6e | 22 | When <type> is not specified, it defaults to "blob". |
7672db20 | 23 | |
2c6e4771 JS |
24 | OPTIONS |
25 | ------- | |
26 | ||
27 | -t <type>:: | |
d4f28279 JC |
28 | Specify the type of object to be created (default: "blob"). Possible |
29 | values are `commit`, `tree`, `blob`, and `tag`. | |
2c6e4771 JS |
30 | |
31 | -w:: | |
32 | Actually write the object into the object database. | |
7672db20 | 33 | |
024510c8 DB |
34 | --stdin:: |
35 | Read the object from standard input instead of from a file. | |
36 | ||
d8ee4832 | 37 | --stdin-paths:: |
33e8fc87 JH |
38 | Read file names from the standard input, one per line, instead |
39 | of from the command-line. | |
d8ee4832 | 40 | |
39702431 | 41 | --path:: |
cf6cac20 EN |
42 | Hash object as if it were located at the given path. The location of |
43 | the file does not directly influence the hash value, but the path is | |
44 | used to determine which Git filters should be applied to the object | |
45 | before it can be placed in the object database. As a result of | |
39702431 DP |
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 | ||
4a3d85dc DP |
51 | --no-filters:: |
52 | Hash the contents as is, ignoring any input filter that would | |
6b677a28 | 53 | have been chosen by the attributes mechanism, including the end-of-line |
4a3d85dc | 54 | conversion. If the file is read from standard input then this |
83115ac4 ES |
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. | |
4a3d85dc | 62 | |
7672db20 BL |
63 | GIT |
64 | --- | |
9e1f0a85 | 65 | Part of the linkgit:git[1] suite |