blob: 814e74406ae4fb6ac68213df1f7e8e0192d1dbaf [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-hash-object(1)
2==================
3
4NAME
5----
Junio C Hamano7c73c662007-01-19 00:37:506git-hash-object - Compute object ID and optionally creates a blob from a file
Junio C Hamano1a4e8412005-12-27 08:17:237
8
9SYNOPSIS
10--------
Junio C Hamano5cf43ca2008-08-20 09:14:1411[verse]
Junio C Hamano4cc4a842015-05-11 22:41:0212'git hash-object' [-t <type>] [-w] [--path=<file>|--no-filters] [--stdin [--literally]] [--] <file>...
Junio C Hamanodaf0aae2015-10-26 23:14:3013'git hash-object' [-t <type>] [-w] --stdin-paths [--no-filters]
Junio C Hamano1a4e8412005-12-27 08:17:2314
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.
Junio C Hamano1aa40d22010-01-21 17:46:4321This is used by 'git cvsimport' to update the index
Junio C Hamano1a4e8412005-12-27 08:17:2322without modifying files in the work tree. When <type> is not
Junio C Hamanoa77a5132007-06-08 16:13:4423specified, it defaults to "blob".
Junio C Hamano1a4e8412005-12-27 08:17:2324
25OPTIONS
26-------
27
28-t <type>::
29Specify the type (default: "blob").
30
31-w::
32Actually write the object into the object database.
33
34--stdin::
35Read the object from standard input instead of from a file.
36
Junio C Hamanodfccbb02008-05-26 01:16:1437--stdin-paths::
Junio C Hamanodaf0aae2015-10-26 23:14:3038Read file names from the standard input, one per line, instead
39of from the command-line.
Junio C Hamanodfccbb02008-05-26 01:16:1440
Junio C Hamano5cf43ca2008-08-20 09:14:1441--path::
42Hash object as it were located at the given path. The location of
43file does not directly influence on the hash value, but path is
Junio C Hamano076ffcc2013-02-06 05:13:2144used to determine what Git filters should be applied to the object
Junio C Hamano5cf43ca2008-08-20 09:14:1445before it can be placed to the object database, and, as result of
46applying filters, the actual blob put into the object database may
47differ from the given file. This option is mainly useful for hashing
48temporary files located outside of the working directory or files
49read from stdin.
50
51--no-filters::
52Hash the contents as is, ignoring any input filter that would
Junio C Hamano619596a2010-08-18 22:15:3553have been chosen by the attributes mechanism, including the end-of-line
Junio C Hamano5cf43ca2008-08-20 09:14:1454conversion. If the file is read from standard input then this
Junio C Hamano4cc4a842015-05-11 22:41:0255is always implied, unless the `--path` option is given.
56
57--literally::
58Allow `--stdin` to hash any garbage into a loose object which might not
59otherwise pass standard object parsing or git-fsck checks. Useful for
60stress-testing Git itself or reproducing characteristics of corrupt or
61bogus objects encountered in the wild.
Junio C Hamano5cf43ca2008-08-20 09:14:1462
Junio C Hamano1a4e8412005-12-27 08:17:2363GIT
64---
Junio C Hamanof7c042d2008-06-06 22:50:5365Part of the linkgit:git[1] suite