git-hash-object.txt 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. git-hash-object(1)
  2. ==================
  3. NAME
  4. ----
  5. git-hash-object - Compute object ID and optionally creates a blob from a file
  6. SYNOPSIS
  7. --------
  8. [verse]
  9. 'git hash-object' [-t <type>] [-w] [--path=<file>|--no-filters] [--stdin [--literally]] [--] <file>...
  10. 'git hash-object' [-t <type>] [-w] --stdin-paths [--no-filters]
  11. DESCRIPTION
  12. -----------
  13. Computes the object ID value for an object with specified type
  14. with the contents of the named file (which can be outside of the
  15. work tree), and optionally writes the resulting object into the
  16. object database. Reports its object ID to its standard output.
  17. When <type> is not specified, it defaults to "blob".
  18. OPTIONS
  19. -------
  20. -t <type>::
  21. Specify the type (default: "blob").
  22. -w::
  23. Actually write the object into the object database.
  24. --stdin::
  25. Read the object from standard input instead of from a file.
  26. --stdin-paths::
  27. Read file names from the standard input, one per line, instead
  28. of from the command-line.
  29. --path::
  30. Hash object as it were located at the given path. The location of
  31. file does not directly influence on the hash value, but path is
  32. used to determine what Git filters should be applied to the object
  33. before it can be placed to the object database, and, as result of
  34. applying filters, the actual blob put into the object database may
  35. differ from the given file. This option is mainly useful for hashing
  36. temporary files located outside of the working directory or files
  37. read from stdin.
  38. --no-filters::
  39. Hash the contents as is, ignoring any input filter that would
  40. have been chosen by the attributes mechanism, including the end-of-line
  41. conversion. If the file is read from standard input then this
  42. is always implied, unless the `--path` option is given.
  43. --literally::
  44. Allow `--stdin` to hash any garbage into a loose object which might not
  45. otherwise pass standard object parsing or git-fsck checks. Useful for
  46. stress-testing Git itself or reproducing characteristics of corrupt or
  47. bogus objects encountered in the wild.
  48. GIT
  49. ---
  50. Part of the linkgit:git[1] suite