OSDN Git Service

merge original branch.
[tortoisegit/TortoiseGitJp.git] / doc / source / en / TortoiseGit / git_doc / git-reflog.html.xml
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">\r
3 \r
4 <article lang="en" id="git-reflog(1)">\r
5 <articleinfo>\r
6     <title>git-reflog(1)</title>\r
7         <indexterm>\r
8                 <primary>git-reflog(1)</primary>\r
9         </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-reflog - Manage reflog information</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <simpara><emphasis>git reflog</emphasis> &lt;subcommand&gt; &lt;options&gt;</simpara>\r
18 </simplesect>\r
19 <simplesect id="_description">\r
20 <title>DESCRIPTION</title>\r
21 <simpara>The command takes various subcommands, and different options\r
22 depending on the subcommand:</simpara>\r
23 <blockquote>\r
24 <literallayout><emphasis>git reflog expire</emphasis> [--dry-run] [--stale-fix] [--verbose]\r
25         [--expire=&lt;time&gt;] [--expire-unreachable=&lt;time&gt;] [--all] &lt;refs&gt;&#8230;</literallayout>\r
26 </blockquote>\r
27 <simpara>+\r
28 <emphasis>git reflog delete</emphasis> ref@{specifier}&#8230;</simpara>\r
29 <simpara>+\r
30 <emphasis>git reflog</emphasis> [<emphasis>show</emphasis>] [log-options] [&lt;ref&gt;]</simpara>\r
31 <simpara>Reflog is a mechanism to record when the tip of branches are\r
32 updated.  This command is to manage the information recorded in it.</simpara>\r
33 <simpara>The subcommand "expire" is used to prune older reflog entries.\r
34 Entries older than <literal>expire</literal> time, or entries older than\r
35 <literal>expire-unreachable</literal> time and not reachable from the current\r
36 tip, are removed from the reflog.  This is typically not used\r
37 directly by the end users&#8201;&#8212;&#8201;instead, see <xref linkend="git-gc(1)"/>.</simpara>\r
38 <simpara>The subcommand "show" (which is also the default, in the absence of any\r
39 subcommands) will take all the normal log options, and show the log of\r
40 the reference provided in the command-line (or <literal>HEAD</literal>, by default).\r
41 The reflog will cover all recent actions (HEAD reflog records branch switching\r
42 as well).  It is an alias for <literal>git log -g --abbrev-commit --pretty=oneline</literal>;\r
43 see <xref linkend="git-log(1)"/>.</simpara>\r
44 <simpara>The reflog is useful in various git commands, to specify the old value\r
45 of a reference. For example, <literal>HEAD@{2}</literal> means "where HEAD used to be\r
46 two moves ago", <literal>master@{one.week.ago}</literal> means "where master used to\r
47 point to one week ago", and so on. See <xref linkend="git-rev-parse(1)"/> for\r
48 more details.</simpara>\r
49 <simpara>To delete single entries from the reflog, use the subcommand "delete"\r
50 and specify the <emphasis>exact</emphasis> entry (e.g. "<literal>git reflog delete master@{2}</literal>").</simpara>\r
51 </simplesect>\r
52 <simplesect id="_options">\r
53 <title>OPTIONS</title>\r
54 <variablelist>\r
55 <varlistentry>\r
56 <term>\r
57 --stale-fix\r
58 </term>\r
59 <listitem>\r
60 <simpara>\r
61         This revamps the logic&#8201;&#8212;&#8201;the definition of "broken commit"\r
62         becomes: a commit that is not reachable from any of the refs and\r
63         there is a missing object among the commit, tree, or blob\r
64         objects reachable from it that is not reachable from any of the\r
65         refs.\r
66 </simpara>\r
67 <simpara>This computation involves traversing all the reachable objects, i.e. it\r
68 has the same cost as <emphasis>git-prune</emphasis>.  Fortunately, once this is run, we\r
69 should not have to ever worry about missing objects, because the current\r
70 prune and pack-objects know about reflogs and protect objects referred by\r
71 them.</simpara>\r
72 </listitem>\r
73 </varlistentry>\r
74 <varlistentry>\r
75 <term>\r
76 --expire=&lt;time&gt;\r
77 </term>\r
78 <listitem>\r
79 <simpara>\r
80         Entries older than this time are pruned.  Without the\r
81         option it is taken from configuration <literal>gc.reflogExpire</literal>,\r
82         which in turn defaults to 90 days.\r
83 </simpara>\r
84 </listitem>\r
85 </varlistentry>\r
86 <varlistentry>\r
87 <term>\r
88 --expire-unreachable=&lt;time&gt;\r
89 </term>\r
90 <listitem>\r
91 <simpara>\r
92         Entries older than this time and not reachable from\r
93         the current tip of the branch are pruned.  Without the\r
94         option it is taken from configuration\r
95         <literal>gc.reflogExpireUnreachable</literal>, which in turn defaults to\r
96         30 days.\r
97 </simpara>\r
98 </listitem>\r
99 </varlistentry>\r
100 <varlistentry>\r
101 <term>\r
102 --all\r
103 </term>\r
104 <listitem>\r
105 <simpara>\r
106         Instead of listing &lt;refs&gt; explicitly, prune all refs.\r
107 </simpara>\r
108 </listitem>\r
109 </varlistentry>\r
110 <varlistentry>\r
111 <term>\r
112 --updateref\r
113 </term>\r
114 <listitem>\r
115 <simpara>\r
116         Update the ref with the sha1 of the top reflog entry (i.e.\r
117         &lt;ref&gt;@{0}) after expiring or deleting.\r
118 </simpara>\r
119 </listitem>\r
120 </varlistentry>\r
121 <varlistentry>\r
122 <term>\r
123 --rewrite\r
124 </term>\r
125 <listitem>\r
126 <simpara>\r
127         While expiring or deleting, adjust each reflog entry to ensure\r
128         that the <literal>old</literal> sha1 field points to the <literal>new</literal> sha1 field of the\r
129         previous entry.\r
130 </simpara>\r
131 </listitem>\r
132 </varlistentry>\r
133 <varlistentry>\r
134 <term>\r
135 --verbose\r
136 </term>\r
137 <listitem>\r
138 <simpara>\r
139         Print extra information on screen.\r
140 </simpara>\r
141 </listitem>\r
142 </varlistentry>\r
143 </variablelist>\r
144 </simplesect>\r
145 <simplesect id="_author">\r
146 <title>Author</title>\r
147 <simpara>Written by Junio C Hamano &lt;<ulink url="mailto:gitster@pobox.com">gitster@pobox.com</ulink>&gt;</simpara>\r
148 </simplesect>\r
149 <simplesect id="_documentation">\r
150 <title>Documentation</title>\r
151 <simpara>Documentation by Junio C Hamano and the git-list &lt;<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>&gt;.</simpara>\r
152 </simplesect>\r
153 <simplesect id="_git">\r
154 <title>GIT</title>\r
155 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>\r
156 </simplesect>\r
157 </article>\r