updated git doc
[TortoiseGit.git] / doc / source / en / TortoiseGit / git_doc / git-show-branch.xml
blobbde96e9b567832ff30701eacf9aac105b15a07af
1 <?xml version="1.0" encoding="UTF-8"?>\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">\r
3 \r
4 <article lang="en" id="git-show-branch(1)">\r
5 <articleinfo>\r
6     <title>git-show-branch(1)</title>\r
7 <indexterm>\r
8 <primary>git-show-branch(1)</primary>\r
9 </indexterm>\r
10 </articleinfo>\r
11 <simplesect id="_name">\r
12 <title>NAME</title>\r
13 <simpara>git-show-branch - Show branches and their commits</simpara>\r
14 </simplesect>\r
15 <simplesect id="_synopsis">\r
16 <title>SYNOPSIS</title>\r
17 <blockquote>\r
18 <literallayout><emphasis>git show-branch</emphasis> [-a|--all] [-r|--remotes] [--topo-order | --date-order]\r
19                 [--current] [--color[=&lt;when&gt;] | --no-color] [--sparse]\r
20                 [--more=&lt;n&gt; | --list | --independent | --merge-base]\r
21                 [--no-name | --sha1-name] [--topics]\r
22                 [(&lt;rev&gt; | &lt;glob&gt;)&#8230;]\r
23 <emphasis>git show-branch</emphasis> (-g|--reflog)[=&lt;n&gt;[,&lt;base&gt;]] [--list] [&lt;ref&gt;]</literallayout>\r
24 </blockquote>\r
25 </simplesect>\r
26 <simplesect id="_description">\r
27 <title>DESCRIPTION</title>\r
28 <simpara>Shows the commit ancestry graph starting from the commits named\r
29 with &lt;rev&gt;s or &lt;globs&gt;s (or all refs under refs/heads\r
30 and/or refs/tags) semi-visually.</simpara>\r
31 <simpara>It cannot show more than 29 branches and commits at a time.</simpara>\r
32 <simpara>It uses <emphasis>showbranch.default</emphasis> multi-valued configuration items if\r
33 no &lt;rev&gt; nor &lt;glob&gt; is given on the command line.</simpara>\r
34 </simplesect>\r
35 <simplesect id="_options">\r
36 <title>OPTIONS</title>\r
37 <variablelist>\r
38 <varlistentry>\r
39 <term>\r
40 &lt;rev&gt;\r
41 </term>\r
42 <listitem>\r
43 <simpara>\r
44         Arbitrary extended SHA1 expression (see <xref linkend="gitrevisions(7)" />)\r
45         that typically names a branch head or a tag.\r
46 </simpara>\r
47 </listitem>\r
48 </varlistentry>\r
49 <varlistentry>\r
50 <term>\r
51 &lt;glob&gt;\r
52 </term>\r
53 <listitem>\r
54 <simpara>\r
55         A glob pattern that matches branch or tag names under\r
56         refs/.  For example, if you have many topic\r
57         branches under refs/heads/topic, giving\r
58         <emphasis>topic/*</emphasis> would show all of them.\r
59 </simpara>\r
60 </listitem>\r
61 </varlistentry>\r
62 <varlistentry>\r
63 <term>\r
64 -r\r
65 </term>\r
66 <term>\r
67 --remotes\r
68 </term>\r
69 <listitem>\r
70 <simpara>\r
71         Show the remote-tracking branches.\r
72 </simpara>\r
73 </listitem>\r
74 </varlistentry>\r
75 <varlistentry>\r
76 <term>\r
77 -a\r
78 </term>\r
79 <term>\r
80 --all\r
81 </term>\r
82 <listitem>\r
83 <simpara>\r
84         Show both remote-tracking branches and local branches.\r
85 </simpara>\r
86 </listitem>\r
87 </varlistentry>\r
88 <varlistentry>\r
89 <term>\r
90 --current\r
91 </term>\r
92 <listitem>\r
93 <simpara>\r
94         With this option, the command includes the current\r
95         branch to the list of revs to be shown when it is not\r
96         given on the command line.\r
97 </simpara>\r
98 </listitem>\r
99 </varlistentry>\r
100 <varlistentry>\r
101 <term>\r
102 --topo-order\r
103 </term>\r
104 <listitem>\r
105 <simpara>\r
106         By default, the branches and their commits are shown in\r
107         reverse chronological order.  This option makes them\r
108         appear in topological order (i.e., descendant commits\r
109         are shown before their parents).\r
110 </simpara>\r
111 </listitem>\r
112 </varlistentry>\r
113 <varlistentry>\r
114 <term>\r
115 --date-order\r
116 </term>\r
117 <listitem>\r
118 <simpara>\r
119         This option is similar to <emphasis>--topo-order</emphasis> in the sense that no\r
120         parent comes before all of its children, but otherwise commits\r
121         are ordered according to their commit date.\r
122 </simpara>\r
123 </listitem>\r
124 </varlistentry>\r
125 <varlistentry>\r
126 <term>\r
127 --sparse\r
128 </term>\r
129 <listitem>\r
130 <simpara>\r
131         By default, the output omits merges that are reachable\r
132         from only one tip being shown.  This option makes them\r
133         visible.\r
134 </simpara>\r
135 </listitem>\r
136 </varlistentry>\r
137 <varlistentry>\r
138 <term>\r
139 --more=&lt;n&gt;\r
140 </term>\r
141 <listitem>\r
142 <simpara>\r
143         Usually the command stops output upon showing the commit\r
144         that is the common ancestor of all the branches.  This\r
145         flag tells the command to go &lt;n&gt; more common commits\r
146         beyond that.  When &lt;n&gt; is negative, display only the\r
147         &lt;reference&gt;s given, without showing the commit ancestry\r
148         tree.\r
149 </simpara>\r
150 </listitem>\r
151 </varlistentry>\r
152 <varlistentry>\r
153 <term>\r
154 --list\r
155 </term>\r
156 <listitem>\r
157 <simpara>\r
158         Synonym to <emphasis>--more=-1</emphasis>\r
159 </simpara>\r
160 </listitem>\r
161 </varlistentry>\r
162 <varlistentry>\r
163 <term>\r
164 --merge-base\r
165 </term>\r
166 <listitem>\r
167 <simpara>\r
168         Instead of showing the commit list, determine possible\r
169         merge bases for the specified commits. All merge bases\r
170         will be contained in all specified commits. This is\r
171         different from how <xref linkend="git-merge-base(1)" /> handles\r
172         the case of three or more commits.\r
173 </simpara>\r
174 </listitem>\r
175 </varlistentry>\r
176 <varlistentry>\r
177 <term>\r
178 --independent\r
179 </term>\r
180 <listitem>\r
181 <simpara>\r
182         Among the &lt;reference&gt;s given, display only the ones that\r
183         cannot be reached from any other &lt;reference&gt;.\r
184 </simpara>\r
185 </listitem>\r
186 </varlistentry>\r
187 <varlistentry>\r
188 <term>\r
189 --no-name\r
190 </term>\r
191 <listitem>\r
192 <simpara>\r
193         Do not show naming strings for each commit.\r
194 </simpara>\r
195 </listitem>\r
196 </varlistentry>\r
197 <varlistentry>\r
198 <term>\r
199 --sha1-name\r
200 </term>\r
201 <listitem>\r
202 <simpara>\r
203         Instead of naming the commits using the path to reach\r
204         them from heads (e.g. "master~2" to mean the grandparent\r
205         of "master"), name them with the unique prefix of their\r
206         object names.\r
207 </simpara>\r
208 </listitem>\r
209 </varlistentry>\r
210 <varlistentry>\r
211 <term>\r
212 --topics\r
213 </term>\r
214 <listitem>\r
215 <simpara>\r
216         Shows only commits that are NOT on the first branch given.\r
217         This helps track topic branches by hiding any commit that\r
218         is already in the main line of development.  When given\r
219         "git show-branch --topics master topic1 topic2", this\r
220         will show the revisions given by "git rev-list &#94;master\r
221         topic1 topic2"\r
222 </simpara>\r
223 </listitem>\r
224 </varlistentry>\r
225 <varlistentry>\r
226 <term>\r
227 -g\r
228 </term>\r
229 <term>\r
230 --reflog[=&lt;n&gt;[,&lt;base&gt;]] [&lt;ref&gt;]\r
231 </term>\r
232 <listitem>\r
233 <simpara>\r
234         Shows &lt;n&gt; most recent ref-log entries for the given\r
235         ref.  If &lt;base&gt; is given, &lt;n&gt; entries going back from\r
236         that entry.  &lt;base&gt; can be specified as count or date.\r
237         When no explicit &lt;ref&gt; parameter is given, it defaults to the\r
238         current branch (or <emphasis>HEAD</emphasis> if it is detached).\r
239 </simpara>\r
240 </listitem>\r
241 </varlistentry>\r
242 <varlistentry>\r
243 <term>\r
244 --color[=&lt;when&gt;]\r
245 </term>\r
246 <listitem>\r
247 <simpara>\r
248         Color the status sign (one of these: <emphasis>*</emphasis> <emphasis>!</emphasis> <emphasis>+</emphasis> <emphasis>-</emphasis>) of each commit\r
249         corresponding to the branch it's in.\r
250         The value must be always (the default), never, or auto.\r
251 </simpara>\r
252 </listitem>\r
253 </varlistentry>\r
254 <varlistentry>\r
255 <term>\r
256 --no-color\r
257 </term>\r
258 <listitem>\r
259 <simpara>\r
260         Turn off colored output, even when the configuration file gives the\r
261         default to color output.\r
262         Same as <emphasis>--color=never</emphasis>.\r
263 </simpara>\r
264 </listitem>\r
265 </varlistentry>\r
266 </variablelist>\r
267 <simpara>Note that --more, --list, --independent and --merge-base options\r
268 are mutually exclusive.</simpara>\r
269 </simplesect>\r
270 <simplesect id="_output">\r
271 <title>OUTPUT</title>\r
272 <simpara>Given N &lt;references&gt;, the first N lines are the one-line\r
273 description from their commit message.  The branch head that is\r
274 pointed at by $GIT_DIR/HEAD is prefixed with an asterisk <emphasis>*</emphasis>\r
275 character while other heads are prefixed with a <emphasis>!</emphasis> character.</simpara>\r
276 <simpara>Following these N lines, one-line log for each commit is\r
277 displayed, indented N places.  If a commit is on the I-th\r
278 branch, the I-th indentation character shows a <emphasis>+</emphasis> sign;\r
279 otherwise it shows a space.  Merge commits are denoted by\r
280 a <emphasis>-</emphasis> sign.  Each commit shows a short name that\r
281 can be used as an extended SHA1 to name that commit.</simpara>\r
282 <simpara>The following example shows three branches, "master", "fixes"\r
283 and "mhf":</simpara>\r
284 <screen>$ git show-branch master fixes mhf\r
285 * [master] Add 'git show-branch'.\r
286  ! [fixes] Introduce "reset type" flag to "git reset"\r
287   ! [mhf] Allow "+remote:local" refspec to cause --force when fetching.\r
288 ---\r
289   + [mhf] Allow "+remote:local" refspec to cause --force when fetching.\r
290   + [mhf~1] Use git-octopus when pulling more than one heads.\r
291  +  [fixes] Introduce "reset type" flag to "git reset"\r
292   + [mhf~2] "git fetch --force".\r
293   + [mhf~3] Use .git/remote/origin, not .git/branches/origin.\r
294   + [mhf~4] Make "git pull" and "git fetch" default to origin\r
295   + [mhf~5] Infamous 'octopus merge'\r
296   + [mhf~6] Retire git-parse-remote.\r
297   + [mhf~7] Multi-head fetch.\r
298   + [mhf~8] Start adding the $GIT_DIR/remotes/ support.\r
299 *++ [master] Add 'git show-branch'.</screen>\r
300 <simpara>These three branches all forked from a common commit, [master],\r
301 whose commit message is "Add &#39;git show-branch&#39;".\r
302 The "fixes" branch adds one commit "Introduce "reset type" flag to\r
303 "git reset"". The "mhf" branch adds many other commits.\r
304 The current branch is "master".</simpara>\r
305 </simplesect>\r
306 <simplesect id="_example">\r
307 <title>EXAMPLE</title>\r
308 <simpara>If you keep your primary branches immediately under\r
309 <emphasis>refs/heads</emphasis>, and topic branches in subdirectories of\r
310 it, having the following in the configuration file may help:</simpara>\r
311 <screen>[showbranch]\r
312         default = --topo-order\r
313         default = heads/*</screen>\r
314 <simpara>With this, <emphasis>git show-branch</emphasis> without extra parameters would show\r
315 only the primary branches.  In addition, if you happen to be on\r
316 your topic branch, it is shown as well.</simpara>\r
317 <screen>$ git show-branch --reflog="10,1 hour ago" --list master</screen>\r
318 <simpara>shows 10 reflog entries going back from the tip as of 1 hour ago.\r
319 Without <emphasis>--list</emphasis>, the output also shows how these tips are\r
320 topologically related with each other.</simpara>\r
321 </simplesect>\r
322 <simplesect id="_git">\r
323 <title>GIT</title>\r
324 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>\r
325 </simplesect>\r
326 </article>\r