]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-hash-object.txt
Merge tag 'l10n-2.24.0-rnd2' of https://github.com/git-l10n/git-po
[thirdparty/git.git] / Documentation / git-hash-object.txt
CommitLineData
7672db20
BL
1git-hash-object(1)
2==================
7672db20
BL
3
4NAME
5----
c3f0baac 6git-hash-object - Compute object ID and optionally creates a blob from a file
7672db20
BL
7
8
9SYNOPSIS
10--------
9ae8e008 11[verse]
83115ac4 12'git hash-object' [-t <type>] [-w] [--path=<file>|--no-filters] [--stdin [--literally]] [--] <file>...
33e8fc87 13'git hash-object' [-t <type>] [-w] --stdin-paths [--no-filters]
7672db20
BL
14
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.
afc3bf6e 21When <type> is not specified, it defaults to "blob".
7672db20 22
2c6e4771
JS
23OPTIONS
24-------
25
26-t <type>::
27 Specify the type (default: "blob").
28
29-w::
30 Actually write the object into the object database.
7672db20 31
024510c8
DB
32--stdin::
33 Read the object from standard input instead of from a file.
34
d8ee4832 35--stdin-paths::
33e8fc87
JH
36 Read file names from the standard input, one per line, instead
37 of from the command-line.
d8ee4832 38
39702431
DP
39--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
2de9b711 42 used to determine what Git filters should be applied to the object
39702431
DP
43 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
4a3d85dc
DP
49--no-filters::
50 Hash the contents as is, ignoring any input filter that would
6b677a28 51 have been chosen by the attributes mechanism, including the end-of-line
4a3d85dc 52 conversion. If the file is read from standard input then this
83115ac4
ES
53 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.
4a3d85dc 60
7672db20
BL
61GIT
62---
9e1f0a85 63Part of the linkgit:git[1] suite