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
4 <article lang="en" id="git-show-branch(1)">
\r
6 <title>git-show-branch(1)</title>
\r
8 <primary>git-show-branch(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-show-branch - Show branches and their commits</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
18 <literallayout><emphasis>git show-branch</emphasis> [-a|--all] [-r|--remotes] [--topo-order | --date-order]
\r
19 [--current] [--color[=<when>] | --no-color] [--sparse]
\r
20 [--more=<n> | --list | --independent | --merge-base]
\r
21 [--no-name | --sha1-name] [--topics]
\r
22 [(<rev> | <glob>)…]
\r
23 <emphasis>git show-branch</emphasis> (-g|--reflog)[=<n>[,<base>]] [--list] [<ref>]</literallayout>
\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 <rev>s or <globs>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 <rev> nor <glob> is given on the command line.</simpara>
\r
35 <simplesect id="_options">
\r
36 <title>OPTIONS</title>
\r
44 Arbitrary extended SHA1 expression (see <xref linkend="gitrevisions(7)" />)
\r
45 that typically names a branch head or a tag.
\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
71 Show the remote-tracking branches.
\r
84 Show both remote-tracking branches and local branches.
\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
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
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
131 By default, the output omits merges that are reachable
\r
132 from only one tip being shown. This option makes them
\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 <n> more common commits
\r
146 beyond that. When <n> is negative, display only the
\r
147 <reference>s given, without showing the commit ancestry
\r
158 Synonym to <emphasis>--more=-1</emphasis>
\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
182 Among the <reference>s given, display only the ones that
\r
183 cannot be reached from any other <reference>.
\r
193 Do not show naming strings for each commit.
\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
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 ^master
\r
230 --reflog[=<n>[,<base>]] [<ref>]
\r
234 Shows <n> most recent ref-log entries for the given
\r
235 ref. If <base> is given, <n> entries going back from
\r
236 that entry. <base> can be specified as count or date.
\r
237 When no explicit <ref> parameter is given, it defaults to the
\r
238 current branch (or <emphasis>HEAD</emphasis> if it is detached).
\r
244 --color[=<when>]
\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
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
267 <simpara>Note that --more, --list, --independent and --merge-base options
\r
268 are mutually exclusive.</simpara>
\r
270 <simplesect id="_output">
\r
271 <title>OUTPUT</title>
\r
272 <simpara>Given N <references>, 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
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 'git show-branch'".
\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
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
322 <simplesect id="_git">
\r
324 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r