6 git-show-branch - Show branches and their commits
11 'git show-branch' [-a|--all] [-r|--remotes] [--topo-order | --date-order]
12 [--current] [--color[=<when>] | --no-color] [--sparse]
13 [--more=<n> | --list | --independent | --merge-base]
14 [--no-name | --sha1-name] [--topics]
17 'git show-branch' (-g|--reflog)[=<n>[,<base>]] [--list] [<ref>]
22 Shows the commit ancestry graph starting from the commits named
23 with <rev>s or <globs>s (or all refs under refs/heads
24 and/or refs/tags) semi-visually.
26 It cannot show more than 29 branches and commits at a time.
28 It uses `showbranch.default` multi-valued configuration items if
29 no <rev> nor <glob> is given on the command line.
35 Arbitrary extended SHA1 expression (see linkgit:gitrevisions[1])
36 that typically names a branch head or a tag.
39 A glob pattern that matches branch or tag names under
40 refs/. For example, if you have many topic
41 branches under refs/heads/topic, giving
42 `topic/*` would show all of them.
46 Show the remote-tracking branches.
50 Show both remote-tracking branches and local branches.
53 With this option, the command includes the current
54 branch to the list of revs to be shown when it is not
55 given on the command line.
58 By default, the branches and their commits are shown in
59 reverse chronological order. This option makes them
60 appear in topological order (i.e., descendant commits
61 are shown before their parents).
64 This option is similar to '--topo-order' in the sense that no
65 parent comes before all of its children, but otherwise commits
66 are ordered according to their commit date.
69 By default, the output omits merges that are reachable
70 from only one tip being shown. This option makes them
74 Usually the command stops output upon showing the commit
75 that is the common ancestor of all the branches. This
76 flag tells the command to go <n> more common commits
77 beyond that. When <n> is negative, display only the
78 <reference>s given, without showing the commit ancestry
82 Synonym to `--more=-1`
85 Instead of showing the commit list, determine possible
86 merge bases for the specified commits. All merge bases
87 will be contained in all specified commits. This is
88 different from how linkgit:git-merge-base[1] handles
89 the case of three or more commits.
92 Among the <reference>s given, display only the ones that
93 cannot be reached from any other <reference>.
96 Do not show naming strings for each commit.
99 Instead of naming the commits using the path to reach
100 them from heads (e.g. "master~2" to mean the grandparent
101 of "master"), name them with the unique prefix of their
105 Shows only commits that are NOT on the first branch given.
106 This helps track topic branches by hiding any commit that
107 is already in the main line of development. When given
108 "git show-branch --topics master topic1 topic2", this
109 will show the revisions given by "git rev-list {caret}master
113 --reflog[=<n>[,<base>]] [<ref>]::
114 Shows <n> most recent ref-log entries for the given
115 ref. If <base> is given, <n> entries going back from
116 that entry. <base> can be specified as count or date.
117 When no explicit <ref> parameter is given, it defaults to the
118 current branch (or `HEAD` if it is detached).
121 Color the status sign (one of these: `*` `!` `+` `-`) of each commit
122 corresponding to the branch it's in.
123 The value must be always (the default), never, or auto.
126 Turn off colored output, even when the configuration file gives the
127 default to color output.
128 Same as `--color=never`.
130 Note that --more, --list, --independent and --merge-base options
131 are mutually exclusive.
136 Given N <references>, the first N lines are the one-line
137 description from their commit message. The branch head that is
138 pointed at by $GIT_DIR/HEAD is prefixed with an asterisk `*`
139 character while other heads are prefixed with a `!` character.
141 Following these N lines, one-line log for each commit is
142 displayed, indented N places. If a commit is on the I-th
143 branch, the I-th indentation character shows a `+` sign;
144 otherwise it shows a space. Merge commits are denoted by
145 a `-` sign. Each commit shows a short name that
146 can be used as an extended SHA1 to name that commit.
148 The following example shows three branches, "master", "fixes"
151 ------------------------------------------------
152 $ git show-branch master fixes mhf
153 * [master] Add 'git show-branch'.
154 ! [fixes] Introduce "reset type" flag to "git reset"
155 ! [mhf] Allow "+remote:local" refspec to cause --force when fetching.
157 + [mhf] Allow "+remote:local" refspec to cause --force when fetching.
158 + [mhf~1] Use git-octopus when pulling more than one heads.
159 + [fixes] Introduce "reset type" flag to "git reset"
160 + [mhf~2] "git fetch --force".
161 + [mhf~3] Use .git/remote/origin, not .git/branches/origin.
162 + [mhf~4] Make "git pull" and "git fetch" default to origin
163 + [mhf~5] Infamous 'octopus merge'
164 + [mhf~6] Retire git-parse-remote.
165 + [mhf~7] Multi-head fetch.
166 + [mhf~8] Start adding the $GIT_DIR/remotes/ support.
167 *++ [master] Add 'git show-branch'.
168 ------------------------------------------------
170 These three branches all forked from a common commit, [master],
171 whose commit message is "Add {apostrophe}git show-branch{apostrophe}".
172 The "fixes" branch adds one commit "Introduce "reset type" flag to
173 "git reset"". The "mhf" branch adds many other commits.
174 The current branch is "master".
180 If you keep your primary branches immediately under
181 `refs/heads`, and topic branches in subdirectories of
182 it, having the following in the configuration file may help:
186 default = --topo-order
191 With this, `git show-branch` without extra parameters would show
192 only the primary branches. In addition, if you happen to be on
193 your topic branch, it is shown as well.
196 $ git show-branch --reflog="10,1 hour ago" --list master
199 shows 10 reflog entries going back from the tip as of 1 hour ago.
200 Without `--list`, the output also shows how these tips are
201 topologically related with each other.
206 Written by Junio C Hamano <gitster@pobox.com>
211 Documentation by Junio C Hamano.
216 Part of the linkgit:git[1] suite