2 .\" Title: git-show-branch
3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
7 .\" Source: Git 2.44.0.53.g0f9d4d28b7
10 .TH "GIT\-SHOW\-BRANCH" "1" "2024\-02\-27" "Git 2\&.44\&.0\&.53\&.g0f9d4d2" "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>]
45 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\&.
47 It cannot show more than 29 branches and commits at a time\&.
49 It uses \fBshowbranch\&.default\fR multi\-valued configuration items if no <rev> or <glob> is given on the command line\&.
54 Arbitrary extended SHA\-1 expression (see
55 \fBgitrevisions\fR(7)) that typically names a branch head or a tag\&.
60 A glob pattern that matches branch or tag names under refs/\&. For example, if you have many topic branches under refs/heads/topic, giving
62 would show all of them\&.
67 Show the remote\-tracking branches\&.
72 Show both remote\-tracking branches and local branches\&.
77 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\&.
82 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)\&.
87 This option is similar to
89 in the sense that no parent comes before all of its children, but otherwise commits are ordered according to their commit date\&.
94 By default, the output omits merges that are reachable from only one tip being shown\&. This option makes them visible\&.
99 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\&.
110 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
111 \fBgit-merge-base\fR(1)
112 handles the case of three or more commits\&.
117 Among the <ref>s given, display only the ones that cannot be reached from any other <ref>\&.
122 Do not show naming strings for each commit\&.
127 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\&.
132 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"
135 \-g, \-\-reflog[=<n>[,<base>]] [<ref>]
137 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
139 if it is detached)\&.
144 Color the status sign (one of these:
148 \fB\-\fR) of each commit corresponding to the branch it\(cqs in\&. The value must be always (the default), never, or auto\&.
153 Turn off colored output, even when the configuration file gives the default to color output\&. Same as
154 \fB\-\-color=never\fR\&.
157 Note that \-\-more, \-\-list, \-\-independent, and \-\-merge\-base options are mutually exclusive\&.
160 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\&.
162 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\&.
164 The following example shows three branches, "master", "fixes", and "mhf":
170 $ git show\-branch master fixes mhf
171 * [master] Add \*(Aqgit show\-branch\*(Aq\&.
172 ! [fixes] Introduce "reset type" flag to "git reset"
173 ! [mhf] Allow "+remote:local" refspec to cause \-\-force when fetching\&.
175 + [mhf] Allow "+remote:local" refspec to cause \-\-force when fetching\&.
176 + [mhf~1] Use git\-octopus when pulling more than one head\&.
177 + [fixes] Introduce "reset type" flag to "git reset"
178 + [mhf~2] "git fetch \-\-force"\&.
179 + [mhf~3] Use \&.git/remote/origin, not \&.git/branches/origin\&.
180 + [mhf~4] Make "git pull" and "git fetch" default to origin
181 + [mhf~5] Infamous \*(Aqoctopus merge\*(Aq
182 + [mhf~6] Retire git\-parse\-remote\&.
183 + [mhf~7] Multi\-head fetch\&.
184 + [mhf~8] Start adding the $GIT_DIR/remotes/ support\&.
185 *++ [master] Add \*(Aqgit show\-branch\*(Aq\&.
192 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"\&.
195 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:
202 default = \-\-topo\-order
210 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\&.
216 $ git show\-branch \-\-reflog="10,1 hour ago" \-\-list master
223 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\&.
226 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:
230 The default set of branches for
231 \fBgit-show-branch\fR(1)\&. See
232 \fBgit-show-branch\fR(1)\&.
236 Part of the \fBgit\fR(1) suite