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-reflog.1 (6386B)


  1. '\" t
  2. .\" Title: git-reflog
  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\-REFLOG" "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-reflog \- Manage reflog information
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit reflog\fR [show] [<log\-options>] [<ref>]
  36. \fIgit reflog list\fR
  37. \fIgit reflog expire\fR [\-\-expire=<time>] [\-\-expire\-unreachable=<time>]
  38. [\-\-rewrite] [\-\-updateref] [\-\-stale\-fix]
  39. [\-\-dry\-run | \-n] [\-\-verbose] [\-\-all [\-\-single\-worktree] | <refs>\&...\:]
  40. \fIgit reflog delete\fR [\-\-rewrite] [\-\-updateref]
  41. [\-\-dry\-run | \-n] [\-\-verbose] <ref>@{<specifier>}\&...\:
  42. \fIgit reflog exists\fR <ref>
  43. .fi
  44. .SH "DESCRIPTION"
  45. .sp
  46. This command manages the information recorded in the reflogs\&.
  47. .sp
  48. Reference logs, or "reflogs", record when the tips of branches and other references were updated in the local repository\&. Reflogs are useful in various Git commands, to specify the old value of a reference\&. For example, \fBHEAD@\fR{2} means "where HEAD used to be two moves ago", \fBmaster@\fR{one\&.\fBweek\&.ago\fR} means "where master used to point to one week ago in this local repository", and so on\&. See \fBgitrevisions\fR(7) for more details\&.
  49. .sp
  50. The command takes various subcommands, and different options depending on the subcommand:
  51. .sp
  52. The "show" subcommand (which is also the default, in the absence of any subcommands) shows the log of the reference provided in the command\-line (or \fBHEAD\fR, by default)\&. The reflog covers all recent actions, and in addition the \fBHEAD\fR reflog records branch switching\&. \fBgit\fR \fBreflog\fR \fBshow\fR is an alias for \fBgit\fR \fBlog\fR \fB\-g\fR \fB\-\-abbrev\-commit\fR \fB\-\-pretty=oneline\fR; see \fBgit-log\fR(1) for more information\&.
  53. .sp
  54. The "list" subcommand lists all refs which have a corresponding reflog\&.
  55. .sp
  56. The "expire" subcommand prunes older reflog entries\&. Entries older than \fBexpire\fR time, or entries older than \fBexpire\-unreachable\fR time and not reachable from the current tip, are removed from the reflog\&. This is typically not used directly by end users \(em instead, see \fBgit-gc\fR(1)\&.
  57. .sp
  58. The "delete" subcommand deletes single entries from the reflog\&. Its argument must be an \fIexact\fR entry (e\&.g\&. "\fBgit\fR \fBreflog\fR \fBdelete\fR \fBmaster@\fR{2}")\&. This subcommand is also typically not used directly by end users\&.
  59. .sp
  60. The "exists" subcommand checks whether a ref has a reflog\&. It exits with zero status if the reflog exists, and non\-zero status if it does not\&.
  61. .SH "OPTIONS"
  62. .SS "Options for \fBshow\fR"
  63. .sp
  64. \fBgit\fR \fBreflog\fR \fBshow\fR accepts any of the options accepted by \fBgit\fR \fBlog\fR\&.
  65. .SS "Options for \fBexpire\fR"
  66. .PP
  67. \-\-all
  68. .RS 4
  69. Process the reflogs of all references\&.
  70. .RE
  71. .PP
  72. \-\-single\-worktree
  73. .RS 4
  74. By default when
  75. \fB\-\-all\fR
  76. is specified, reflogs from all working trees are processed\&. This option limits the processing to reflogs from the current working tree only\&.
  77. .RE
  78. .PP
  79. \-\-expire=<time>
  80. .RS 4
  81. Prune entries older than the specified time\&. If this option is not specified, the expiration time is taken from the configuration setting
  82. \fBgc\&.reflogExpire\fR, which in turn defaults to 90 days\&.
  83. \fB\-\-expire=all\fR
  84. prunes entries regardless of their age;
  85. \fB\-\-expire=never\fR
  86. turns off pruning of reachable entries (but see
  87. \fB\-\-expire\-unreachable\fR)\&.
  88. .RE
  89. .PP
  90. \-\-expire\-unreachable=<time>
  91. .RS 4
  92. Prune entries older than
  93. \fI<time>\fR
  94. that are not reachable from the current tip of the branch\&. If this option is not specified, the expiration time is taken from the configuration setting
  95. \fBgc\&.reflogExpireUnreachable\fR, which in turn defaults to 30 days\&.
  96. \fB\-\-expire\-unreachable=all\fR
  97. prunes unreachable entries regardless of their age;
  98. \fB\-\-expire\-unreachable=never\fR
  99. turns off early pruning of unreachable entries (but see
  100. \fB\-\-expire\fR)\&.
  101. .RE
  102. .PP
  103. \-\-updateref
  104. .RS 4
  105. Update the reference to the value of the top reflog entry (i\&.e\&. <ref>@{0}) if the previous top entry was pruned\&. (This option is ignored for symbolic references\&.)
  106. .RE
  107. .PP
  108. \-\-rewrite
  109. .RS 4
  110. If a reflog entry\(cqs predecessor is pruned, adjust its "old" SHA\-1 to be equal to the "new" SHA\-1 field of the entry that now precedes it\&.
  111. .RE
  112. .PP
  113. \-\-stale\-fix
  114. .RS 4
  115. Prune any reflog entries that point to "broken commits"\&. A broken commit is a commit that is not reachable from any of the reference tips and that refers, directly or indirectly, to a missing commit, tree, or blob object\&.
  116. .sp
  117. This computation involves traversing all the reachable objects, i\&.e\&. it has the same cost as
  118. \fIgit prune\fR\&. It is primarily intended to fix corruption caused by garbage collecting using older versions of Git, which didn\(cqt protect objects referred to by reflogs\&.
  119. .RE
  120. .PP
  121. \-n, \-\-dry\-run
  122. .RS 4
  123. Do not actually prune any entries; just show what would have been pruned\&.
  124. .RE
  125. .PP
  126. \-\-verbose
  127. .RS 4
  128. Print extra information on screen\&.
  129. .RE
  130. .SS "Options for \fBdelete\fR"
  131. .sp
  132. \fBgit\fR \fBreflog\fR \fBdelete\fR accepts options \fB\-\-updateref\fR, \fB\-\-rewrite\fR, \fB\-n\fR, \fB\-\-dry\-run\fR, and \fB\-\-verbose\fR, with the same meanings as when they are used with \fBexpire\fR\&.
  133. .SH "GIT"
  134. .sp
  135. Part of the \fBgit\fR(1) suite