2 .\" Title: git-show-branch
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/>
7 .\" Source: Git 2.46.0.551.gc5ee8f2d1c
10 .TH "GIT\-SHOW\-BRANCH" "1" "2024-09-10" "Git 2\&.46\&.0\&.551\&.gc5ee8f" "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 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 git-show-branch \- Show branches and their commits
35 \fIgit show\-branch\fR [\-a | \-\-all] [\-r | \-\-remotes] [\-\-topo\-order | \-\-date\-order]
36 [\-\-current] [\-\-color[=<when>] | \-\-no\-color] [\-\-sparse]
37 [\-\-more=<n> | \-\-list | \-\-independent | \-\-merge\-base]
38 [\-\-no\-name | \-\-sha1\-name] [\-\-topics]
39 [(<rev> | <glob>)\&...\:]
40 \fIgit show\-branch\fR (\-g | \-\-reflog)[=<n>[,<base>]] [\-\-list] [<ref>]
44 Shows the commit ancestry graph starting from the commits named with <rev>s or <glob>s (or all refs under refs/heads and/or refs/tags) semi\-visually\&.
46 It cannot show more than 26 branches and commits at a time\&.
48 It uses \fBshowbranch\&.default\fR multi\-valued configuration items if no <rev> or <glob> is given on the command line\&.
53 Arbitrary extended SHA\-1 expression (see
54 \fBgitrevisions\fR(7)) that typically names a branch head or a tag\&.
59 A glob pattern that matches branch or tag names under refs/\&. For example, if you have many topic branches under refs/heads/topic, giving
61 would show all of them\&.
66 Show the remote\-tracking branches\&.
71 Show both remote\-tracking branches and local branches\&.
76 With this option, the command includes the current branch in the list of revs to be shown when it is not given on the command line\&.
81 By default, the branches and their commits are shown in reverse chronological order\&. This option makes them appear in topological order (i\&.e\&., descendant commits are shown before their parents)\&.
86 This option is similar to
88 in the sense that no parent comes before all of its children, but otherwise commits are ordered according to their commit date\&.
93 By default, the output omits merges that are reachable from only one tip being shown\&. This option makes them visible\&.
98 Usually the command stops output upon showing the commit that is the common ancestor of all the branches\&. This flag tells the command to go <n> more common commits beyond that\&. When <n> is negative, display only the <ref>s given, without showing the commit ancestry tree\&.
109 Instead of showing the commit list, determine possible merge bases for the specified commits\&. All merge bases will be contained in all specified commits\&. This is different from how
110 \fBgit-merge-base\fR(1)
111 handles the case of three or more commits\&.
116 Among the <ref>s given, display only the ones that cannot be reached from any other <ref>\&.
121 Do not show naming strings for each commit\&.
126 Instead of naming the commits using the path to reach them from heads (e\&.g\&. "master~2" to mean the grandparent of "master"), name them with the unique prefix of their object names\&.
131 Shows only commits that are NOT on the first branch given\&. This helps track topic branches by hiding any commit that is already in the main line of development\&. When given "git show\-branch \-\-topics master topic1 topic2", this will show the revisions given by "git rev\-list ^master topic1 topic2"
134 \-g, \-\-reflog[=<n>[,<base>]] [<ref>]
136 Shows <n> most recent ref\-log entries for the given ref\&. If <base> is given, <n> entries going back from that entry\&. <base> can be specified as count or date\&. When no explicit <ref> parameter is given, it defaults to the current branch (or
138 if it is detached)\&.
143 Color the status sign (one of these:
147 \fB\-\fR) of each commit corresponding to the branch it\(cqs in\&. The value must be always (the default), never, or auto\&.
152 Turn off colored output, even when the configuration file gives the default to color output\&. Same as
153 \fB\-\-color=never\fR\&.
156 Note that \-\-more, \-\-list, \-\-independent, and \-\-merge\-base options are mutually exclusive\&.
159 Given N <ref>s, the first N lines are the one\-line description from their commit message\&. The branch head that is pointed at by $GIT_DIR/HEAD is prefixed with an asterisk \fB*\fR character while other heads are prefixed with a \fB!\fR character\&.
161 Following these N lines, a one\-line log for each commit is displayed, indented N places\&. If a commit is on the I\-th branch, the I\-th indentation character shows a \fB+\fR sign; otherwise it shows a space\&. Merge commits are denoted by a \fB\-\fR sign\&. Each commit shows a short name that can be used as an extended SHA\-1 to name that commit\&.
163 The following example shows three branches, "master", "fixes", and "mhf":
169 $ git show\-branch master fixes mhf
170 * [master] Add \*(Aqgit show\-branch\*(Aq\&.
171 ! [fixes] Introduce "reset type" flag to "git reset"
172 ! [mhf] Allow "+remote:local" refspec to cause \-\-force when fetching\&.
174 + [mhf] Allow "+remote:local" refspec to cause \-\-force when fetching\&.
175 + [mhf~1] Use git\-octopus when pulling more than one head\&.
176 + [fixes] Introduce "reset type" flag to "git reset"
177 + [mhf~2] "git fetch \-\-force"\&.
178 + [mhf~3] Use \&.git/remote/origin, not \&.git/branches/origin\&.
179 + [mhf~4] Make "git pull" and "git fetch" default to origin
180 + [mhf~5] Infamous \*(Aqoctopus merge\*(Aq
181 + [mhf~6] Retire git\-parse\-remote\&.
182 + [mhf~7] Multi\-head fetch\&.
183 + [mhf~8] Start adding the $GIT_DIR/remotes/ support\&.
184 *++ [master] Add \*(Aqgit show\-branch\*(Aq\&.
190 These three branches all forked from a common commit, [master], whose commit message is "Add \*(Aqgit show\-branch\*(Aq"\&. The "fixes" branch adds one commit "Introduce "reset type" flag to "git reset""\&. The "mhf" branch adds many other commits\&. The current branch is "master"\&.
193 If you keep your primary branches immediately under \fBrefs/heads\fR, and topic branches in subdirectories of it, having the following in the configuration file may help:
200 default = \-\-topo\-order
207 With this, \fBgit show\-branch\fR without extra parameters would show only the primary branches\&. In addition, if you happen to be on your topic branch, it is shown as well\&.
213 $ git show\-branch \-\-reflog="10,1 hour ago" \-\-list master
219 shows 10 reflog entries going back from the tip as of 1 hour ago\&. Without \fB\-\-list\fR, the output also shows how these tips are topologically related to each other\&.
222 Everything below this line in this section is selectively included from the \fBgit-config\fR(1) documentation\&. The content is the same as what\(cqs found there:
226 The default set of branches for
227 \fBgit-show-branch\fR(1)\&. See
228 \fBgit-show-branch\fR(1)\&.
232 Part of the \fBgit\fR(1) suite