git-index-pack.txt 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. git-index-pack(1)
  2. =================
  3. NAME
  4. ----
  5. git-index-pack - Build pack index file for an existing packed archive
  6. SYNOPSIS
  7. --------
  8. [verse]
  9. 'git index-pack' [-v] [-o <index-file>] <pack-file>
  10. 'git index-pack' --stdin [--fix-thin] [--keep] [-v] [-o <index-file>]
  11. [<pack-file>]
  12. DESCRIPTION
  13. -----------
  14. Reads a packed archive (.pack) from the specified file, and
  15. builds a pack index file (.idx) for it. The packed archive
  16. together with the pack index can then be placed in the
  17. objects/pack/ directory of a Git repository.
  18. OPTIONS
  19. -------
  20. -v::
  21. Be verbose about what is going on, including progress status.
  22. -o <index-file>::
  23. Write the generated pack index into the specified
  24. file. Without this option the name of pack index
  25. file is constructed from the name of packed archive
  26. file by replacing .pack with .idx (and the program
  27. fails if the name of packed archive does not end
  28. with .pack).
  29. --stdin::
  30. When this flag is provided, the pack is read from stdin
  31. instead and a copy is then written to <pack-file>. If
  32. <pack-file> is not specified, the pack is written to
  33. objects/pack/ directory of the current Git repository with
  34. a default name determined from the pack content. If
  35. <pack-file> is not specified consider using --keep to
  36. prevent a race condition between this process and
  37. 'git repack'.
  38. --fix-thin::
  39. Fix a "thin" pack produced by `git pack-objects --thin` (see
  40. linkgit:git-pack-objects[1] for details) by adding the
  41. excluded objects the deltified objects are based on to the
  42. pack. This option only makes sense in conjunction with --stdin.
  43. --keep::
  44. Before moving the index into its final destination
  45. create an empty .keep file for the associated pack file.
  46. This option is usually necessary with --stdin to prevent a
  47. simultaneous 'git repack' process from deleting
  48. the newly constructed pack and index before refs can be
  49. updated to use objects contained in the pack.
  50. --keep=<msg>::
  51. Like --keep create a .keep file before moving the index into
  52. its final destination, but rather than creating an empty file
  53. place '<msg>' followed by an LF into the .keep file. The '<msg>'
  54. message can later be searched for within all .keep files to
  55. locate any which have outlived their usefulness.
  56. --index-version=<version>[,<offset>]::
  57. This is intended to be used by the test suite only. It allows
  58. to force the version for the generated pack index, and to force
  59. 64-bit index entries on objects located above the given offset.
  60. --strict::
  61. Die, if the pack contains broken objects or links.
  62. --check-self-contained-and-connected::
  63. Die if the pack contains broken links. For internal use only.
  64. --fsck-objects::
  65. Die if the pack contains broken objects. For internal use only.
  66. --threads=<n>::
  67. Specifies the number of threads to spawn when resolving
  68. deltas. This requires that index-pack be compiled with
  69. pthreads otherwise this option is ignored with a warning.
  70. This is meant to reduce packing time on multiprocessor
  71. machines. The required amount of memory for the delta search
  72. window is however multiplied by the number of threads.
  73. Specifying 0 will cause Git to auto-detect the number of CPU's
  74. and use maximum 3 threads.
  75. --max-input-size=<size>::
  76. Die, if the pack is larger than <size>.
  77. --object-format=<hash-algorithm>::
  78. Specify the given object format (hash algorithm) for the pack. The valid
  79. values are 'sha1' and (if enabled) 'sha256'. The default is the algorithm for
  80. the current repository (set by `extensions.objectFormat`), or 'sha1' if no
  81. value is set or outside a repository.
  82. +
  83. This option cannot be used with --stdin.
  84. +
  85. include::object-format-disclaimer.txt[]
  86. NOTES
  87. -----
  88. Once the index has been created, the hash that goes into the name of
  89. the pack/idx file is printed to stdout. If --stdin was
  90. also used then this is prefixed by either "pack\t", or "keep\t" if a
  91. new .keep file was successfully created. This is useful to remove a
  92. .keep file used as a lock to prevent the race with 'git repack'
  93. mentioned above.
  94. GIT
  95. ---
  96. Part of the linkgit:git[1] suite