logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

git-pack-refs.1 (5339B)


  1. '\" t
  2. .\" Title: git-pack-refs
  3. .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
  5. .\" Date: 2025-03-14
  6. .\" Manual: Git Manual
  7. .\" Source: Git 2.49.0
  8. .\" Language: English
  9. .\"
  10. .TH "GIT\-PACK\-REFS" "1" "2025-03-14" "Git 2\&.49\&.0" "Git Manual"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. git-pack-refs \- Pack heads and tags for efficient repository access
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit pack\-refs\fR [\-\-all] [\-\-no\-prune] [\-\-auto] [\-\-include <pattern>] [\-\-exclude <pattern>]
  36. .fi
  37. .SH "DESCRIPTION"
  38. .sp
  39. Traditionally, tips of branches and tags (collectively known as \fIrefs\fR) were stored one file per ref in a (sub)directory under \fB$GIT_DIR/refs\fR directory\&. While many branch tips tend to be updated often, most tags and some branch tips are never updated\&. When a repository has hundreds or thousands of tags, this one\-file\-per\-ref format both wastes storage and hurts performance\&.
  40. .sp
  41. This command is used to solve the storage and performance problem by storing the refs in a single file, \fB$GIT_DIR/packed\-refs\fR\&. When a ref is missing from the traditional \fB$GIT_DIR/refs\fR directory hierarchy, it is looked up in this file and used if found\&.
  42. .sp
  43. Subsequent updates to branches always create new files under \fB$GIT_DIR/refs\fR directory hierarchy\&.
  44. .sp
  45. A recommended practice to deal with a repository with too many refs is to pack its refs with \fB\-\-all\fR once, and occasionally run \fBgit\fR \fBpack\-refs\fR\&. Tags are by definition stationary and are not expected to change\&. Branch heads will be packed with the initial \fBpack\-refs\fR \fB\-\-all\fR, but only the currently active branch heads will become unpacked, and the next \fBpack\-refs\fR (without \fB\-\-all\fR) will leave them unpacked\&.
  46. .SH "OPTIONS"
  47. .PP
  48. \-\-all
  49. .RS 4
  50. The command by default packs all tags and refs that are already packed, and leaves other refs alone\&. This is because branches are expected to be actively developed and packing their tips does not help performance\&. This option causes all refs to be packed as well, with the exception of hidden refs, broken refs, and symbolic refs\&. Useful for a repository with many branches of historical interests\&.
  51. .RE
  52. .PP
  53. \-\-no\-prune
  54. .RS 4
  55. The command usually removes loose refs under
  56. \fB$GIT_DIR/refs\fR
  57. hierarchy after packing them\&. This option tells it not to\&.
  58. .RE
  59. .PP
  60. \-\-auto
  61. .RS 4
  62. Pack refs as needed depending on the current state of the ref database\&. The behavior depends on the ref format used by the repository and may change in the future\&.
  63. .sp
  64. .RS 4
  65. .ie n \{\
  66. \h'-04'\(bu\h'+03'\c
  67. .\}
  68. .el \{\
  69. .sp -1
  70. .IP \(bu 2.3
  71. .\}
  72. "files": No special handling for
  73. \fB\-\-auto\fR
  74. has been implemented\&.
  75. .RE
  76. .sp
  77. .RS 4
  78. .ie n \{\
  79. \h'-04'\(bu\h'+03'\c
  80. .\}
  81. .el \{\
  82. .sp -1
  83. .IP \(bu 2.3
  84. .\}
  85. "reftable": Tables are compacted such that they form a geometric sequence\&. For two tables N and N+1, where N+1 is newer, this maintains the property that N is at least twice as big as N+1\&. Only tables that violate this property are compacted\&.
  86. .RE
  87. .RE
  88. .PP
  89. \-\-include <pattern>
  90. .RS 4
  91. Pack refs based on a
  92. \fBglob\fR(\fB7\fR) pattern\&. Repetitions of this option accumulate inclusion patterns\&. If a ref is both included in
  93. \fB\-\-include\fR
  94. and
  95. \fB\-\-exclude\fR,
  96. \fB\-\-exclude\fR
  97. takes precedence\&. Using
  98. \fB\-\-include\fR
  99. will preclude all tags from being included by default\&. Symbolic refs and broken refs will never be packed\&. When used with
  100. \fB\-\-all\fR, it will be a noop\&. Use
  101. \fB\-\-no\-include\fR
  102. to clear and reset the list of patterns\&.
  103. .RE
  104. .PP
  105. \-\-exclude <pattern>
  106. .RS 4
  107. Do not pack refs matching the given
  108. \fBglob\fR(\fB7\fR) pattern\&. Repetitions of this option accumulate exclusion patterns\&. Use
  109. \fB\-\-no\-exclude\fR
  110. to clear and reset the list of patterns\&. If a ref is already packed, including it with
  111. \fB\-\-exclude\fR
  112. will not unpack it\&.
  113. .RE
  114. .sp
  115. When used with \fB\-\-all\fR, pack only loose refs which do not match any of the provided \fB\-\-exclude\fR patterns\&.
  116. .sp
  117. When used with \fB\-\-include\fR, refs provided to \fB\-\-include\fR, minus refs that are provided to \fB\-\-exclude\fR will be packed\&.
  118. .SH "BUGS"
  119. .sp
  120. Older documentation written before the packed\-refs mechanism was introduced may still say things like "\&.git/refs/heads/<branch> file exists" when it means "branch <branch> exists"\&.
  121. .SH "GIT"
  122. .sp
  123. Part of the \fBgit\fR(1) suite