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-prune.1 (3450B)


  1. '\" t
  2. .\" Title: git-prune
  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\-PRUNE" "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-prune \- Prune all unreachable objects from the object database
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit prune\fR [\-n] [\-v] [\-\-progress] [\-\-expire <time>] [\-\-] [<head>\&...\:]
  36. .fi
  37. .SH "DESCRIPTION"
  38. .if n \{\
  39. .sp
  40. .\}
  41. .RS 4
  42. .it 1 an-trap
  43. .nr an-no-space-flag 1
  44. .nr an-break-flag 1
  45. .br
  46. .ps +1
  47. \fBNote\fR
  48. .ps -1
  49. .br
  50. .sp
  51. In most cases, users should run \fIgit gc\fR, which calls \fIgit prune\fR\&. See the section "NOTES", below\&.
  52. .sp .5v
  53. .RE
  54. .sp
  55. This runs \fIgit fsck \-\-unreachable\fR using all the refs available in \fBrefs/\fR, optionally with an additional set of objects specified on the command line, and prunes all unpacked objects unreachable from any of these head objects from the object database\&. In addition, it prunes the unpacked objects that are also found in packs by running \fIgit prune\-packed\fR\&. It also removes entries from \&.git/shallow that are not reachable by any ref\&.
  56. .sp
  57. Note that unreachable, packed objects will remain\&. If this is not desired, see \fBgit-repack\fR(1)\&.
  58. .SH "OPTIONS"
  59. .PP
  60. \-n, \-\-dry\-run
  61. .RS 4
  62. Do not remove anything; just report what it would remove\&.
  63. .RE
  64. .PP
  65. \-v, \-\-verbose
  66. .RS 4
  67. Report all removed objects\&.
  68. .RE
  69. .PP
  70. \-\-progress
  71. .RS 4
  72. Show progress\&.
  73. .RE
  74. .PP
  75. \-\-expire <time>
  76. .RS 4
  77. Only expire loose objects older than <time>\&.
  78. .RE
  79. .PP
  80. \-\-
  81. .RS 4
  82. Do not interpret any more arguments as options\&.
  83. .RE
  84. .PP
  85. <head>\&...\:
  86. .RS 4
  87. In addition to objects reachable from any of our references, keep objects reachable from listed <head>s\&.
  88. .RE
  89. .SH "EXAMPLES"
  90. .sp
  91. To prune objects not used by your repository or another that borrows from your repository via its \&.\fBgit/objects/info/alternates\fR:
  92. .sp
  93. .if n \{\
  94. .RS 4
  95. .\}
  96. .nf
  97. $ git prune $(cd \&.\&./another && git rev\-parse \-\-all)
  98. .fi
  99. .if n \{\
  100. .RE
  101. .\}
  102. .SH "NOTES"
  103. .sp
  104. In most cases, users will not need to call \fIgit prune\fR directly, but should instead call \fIgit gc\fR, which handles pruning along with many other housekeeping tasks\&.
  105. .sp
  106. For a description of which objects are considered for pruning, see \fIgit fsck\fR\*(Aqs \-\-unreachable option\&.
  107. .SH "SEE ALSO"
  108. .sp
  109. \fBgit-fsck\fR(1), \fBgit-gc\fR(1), \fBgit-reflog\fR(1)
  110. .SH "GIT"
  111. .sp
  112. Part of the \fBgit\fR(1) suite