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
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> [--all] [--remotes] [--topo-order] [--current]
\r
19 [--more=<n> | --list | --independent | --merge-base]
\r
20 [--no-name | --sha1-name] [--topics] [<rev> | <glob>]…
\r
21 <emphasis>git show-branch</emphasis> (-g|--reflog)[=<n>[,<base>]] [--list] [<ref>]</literallayout>
\r
24 <simplesect id="_description">
\r
25 <title>DESCRIPTION</title>
\r
26 <simpara>Shows the commit ancestry graph starting from the commits named
\r
27 with <rev>s or <globs>s (or all refs under $GIT_DIR/refs/heads
\r
28 and/or $GIT_DIR/refs/tags) semi-visually.</simpara>
\r
29 <simpara>It cannot show more than 29 branches and commits at a time.</simpara>
\r
30 <simpara>It uses <literal>showbranch.default</literal> multi-valued configuration items if
\r
31 no <rev> nor <glob> is given on the command line.</simpara>
\r
33 <simplesect id="_options">
\r
34 <title>OPTIONS</title>
\r
42 Arbitrary extended SHA1 expression (see <xref linkend="git-rev-parse(1)"/>)
\r
43 that typically names a branch head or a tag.
\r
53 A glob pattern that matches branch or tag names under
\r
54 $GIT_DIR/refs. For example, if you have many topic
\r
55 branches under $GIT_DIR/refs/heads/topic, giving
\r
56 <literal>topic/*</literal> would show all of them.
\r
69 Show the remote-tracking branches.
\r
82 Show both remote-tracking branches and local branches.
\r
92 With this option, the command includes the current
\r
93 branch to the list of revs to be shown when it is not
\r
94 given on the command line.
\r
104 By default, the branches and their commits are shown in
\r
105 reverse chronological order. This option makes them
\r
106 appear in topological order (i.e., descendant commits
\r
107 are shown before their parents).
\r
117 By default, the output omits merges that are reachable
\r
118 from only one tip being shown. This option makes them
\r
129 Usually the command stops output upon showing the commit
\r
130 that is the common ancestor of all the branches. This
\r
131 flag tells the command to go <n> more common commits
\r
132 beyond that. When <n> is negative, display only the
\r
133 <reference>s given, without showing the commit ancestry
\r
144 Synonym to <literal>--more=-1</literal>
\r
154 Instead of showing the commit list, just act like the
\r
155 <emphasis>git-merge-base -a</emphasis> command, except that it can accept
\r
156 more than two heads.
\r
166 Among the <reference>s given, display only the ones that
\r
167 cannot be reached from any other <reference>.
\r
177 Do not show naming strings for each commit.
\r
187 Instead of naming the commits using the path to reach
\r
188 them from heads (e.g. "master~2" to mean the grandparent
\r
189 of "master"), name them with the unique prefix of their
\r
200 Shows only commits that are NOT on the first branch given.
\r
201 This helps track topic branches by hiding any commit that
\r
202 is already in the main line of development. When given
\r
203 "git show-branch --topics master topic1 topic2", this
\r
204 will show the revisions given by "git rev-list ^master
\r
214 --reflog[=<n>[,<base>]] [<ref>]
\r
218 Shows <n> most recent ref-log entries for the given
\r
219 ref. If <base> is given, <n> entries going back from
\r
220 that entry. <base> can be specified as count or date.
\r
221 When no explicit <ref> parameter is given, it defaults to the
\r
222 current branch (or <literal>HEAD</literal> if it is detached).
\r
227 <simpara>Note that --more, --list, --independent and --merge-base options
\r
228 are mutually exclusive.</simpara>
\r
230 <simplesect id="_output">
\r
231 <title>OUTPUT</title>
\r
232 <simpara>Given N <references>, the first N lines are the one-line
\r
233 description from their commit message. The branch head that is
\r
234 pointed at by $GIT_DIR/HEAD is prefixed with an asterisk <literal>*</literal>
\r
235 character while other heads are prefixed with a <literal>!</literal> character.</simpara>
\r
236 <simpara>Following these N lines, one-line log for each commit is
\r
237 displayed, indented N places. If a commit is on the I-th
\r
238 branch, the I-th indentation character shows a <literal>+</literal> sign;
\r
239 otherwise it shows a space. Merge commits are denoted by
\r
240 a <literal>-</literal> sign. Each commit shows a short name that
\r
241 can be used as an extended SHA1 to name that commit.</simpara>
\r
242 <simpara>The following example shows three branches, "master", "fixes"
\r
243 and "mhf":</simpara>
\r
244 <literallayout>$ git show-branch master fixes mhf
\r
245 * [master] Add 'git show-branch'.
\r
246 ! [fixes] Introduce "reset type" flag to "git reset"
\r
247 ! [mhf] Allow "+remote:local" refspec to cause --force when fetching.
\r
249 + [mhf] Allow "+remote:local" refspec to cause --force when fetching.
\r
250 + [mhf~1] Use git-octopus when pulling more than one heads.
\r
251 + [fixes] Introduce "reset type" flag to "git reset"
\r
252 + [mhf~2] "git fetch --force".
\r
253 + [mhf~3] Use .git/remote/origin, not .git/branches/origin.
\r
254 + [mhf~4] Make "git pull" and "git fetch" default to origin
\r
255 + [mhf~5] Infamous 'octopus merge'
\r
256 + [mhf~6] Retire git-parse-remote.
\r
257 + [mhf~7] Multi-head fetch.
\r
258 + [mhf~8] Start adding the $GIT_DIR/remotes/ support.
\r
259 *++ [master] Add 'git show-branch'.</literallayout>
\r
260 <simpara>These three branches all forked from a common commit, [master],
\r
261 whose commit message is "Add <emphasis>git show-branch</emphasis>. "fixes" branch
\r
262 adds one commit <emphasis>Introduce "reset type"</emphasis>. "mhf" branch has many
\r
263 other commits. The current branch is "master".</simpara>
\r
265 <simplesect id="_example">
\r
266 <title>EXAMPLE</title>
\r
267 <simpara>If you keep your primary branches immediately under
\r
268 <literal>$GIT_DIR/refs/heads</literal>, and topic branches in subdirectories of
\r
269 it, having the following in the configuration file may help:</simpara>
\r
270 <literallayout>[showbranch]
\r
271 default = --topo-order
\r
272 default = heads/*</literallayout>
\r
273 <simpara>With this, <literal>git show-branch</literal> without extra parameters would show
\r
274 only the primary branches. In addition, if you happen to be on
\r
275 your topic branch, it is shown as well.</simpara>
\r
276 <literallayout>$ git show-branch --reflog="10,1 hour ago" --list master</literallayout>
\r
277 <simpara>shows 10 reflog entries going back from the tip as of 1 hour ago.
\r
278 Without <literal>--list</literal>, the output also shows how these tips are
\r
279 topologically related with each other.</simpara>
\r
281 <simplesect id="_author">
\r
282 <title>Author</title>
\r
283 <simpara>Written by Junio C Hamano <<ulink url="mailto:gitster@pobox.com">gitster@pobox.com</ulink>></simpara>
\r
285 <simplesect id="_documentation">
\r
286 <title>Documentation</title>
\r
287 <simpara>Documentation by Junio C Hamano.</simpara>
\r
289 <simplesect id="_git">
\r
291 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>
\r