blob: f1499bba88028775032819708db22a3250b5b840 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-show-branch(1)
2==================
3
4NAME
5----
Junio C Hamano01078922006-03-10 00:31:476git-show-branch - Show branches and their commits
Junio C Hamano1a4e8412005-12-27 08:17:237
8SYNOPSIS
9--------
Junio C Hamano38064d52006-01-15 10:13:4910[verse]
Junio C Hamanofd9274d2009-08-05 21:21:3911'git show-branch' [-a|--all] [-r|--remotes] [--topo-order | --date-order]
Junio C Hamano4aa0bcc2010-03-03 05:13:1212[--current] [--color[=<when>] | --no-color] [--sparse]
Junio C Hamano2bb13102006-03-06 07:10:2113[--more=<n> | --list | --independent | --merge-base]
Junio C Hamanocca56612009-06-03 08:27:3314[--no-name | --sha1-name] [--topics]
15[<rev> | <glob>]...
Junio C Hamanofd9274d2009-08-05 21:21:3916
Junio C Hamanofce7c7e2008-07-02 03:06:3817'git show-branch' (-g|--reflog)[=<n>[,<base>]] [--list] [<ref>]
Junio C Hamano1a4e8412005-12-27 08:17:2318
19DESCRIPTION
20-----------
21
22Shows the commit ancestry graph starting from the commits named
Junio C Hamano4fdccb22010-02-19 09:58:1423with <rev>s or <globs>s (or all refs under refs/heads
24and/or refs/tags) semi-visually.
Junio C Hamano1a4e8412005-12-27 08:17:2325
26It cannot show more than 29 branches and commits at a time.
27
Junio C Hamano38064d52006-01-15 10:13:4928It uses `showbranch.default` multi-valued configuration items if
29no <rev> nor <glob> is given on the command line.
30
Junio C Hamano1a4e8412005-12-27 08:17:2331
32OPTIONS
33-------
34<rev>::
Junio C Hamanofce7c7e2008-07-02 03:06:3835Arbitrary extended SHA1 expression (see linkgit:git-rev-parse[1])
Junio C Hamano54bf1e22008-12-20 06:30:1136that typically names a branch head or a tag.
Junio C Hamano1a4e8412005-12-27 08:17:2337
38<glob>::
39A glob pattern that matches branch or tag names under
Junio C Hamano4fdccb22010-02-19 09:58:1440refs/. For example, if you have many topic
41branches under refs/heads/topic, giving
Junio C Hamano1a4e8412005-12-27 08:17:2342`topic/*` would show all of them.
43
Junio C Hamanoeb415992008-06-08 22:49:4744-r::
45--remotes::
Junio C Hamano30e1db12006-12-23 10:29:5246Show the remote-tracking branches.
47
Junio C Hamanoeb415992008-06-08 22:49:4748-a::
49--all::
Junio C Hamano30e1db12006-12-23 10:29:5250Show both remote-tracking branches and local branches.
Junio C Hamano1a4e8412005-12-27 08:17:2351
Junio C Hamano38064d52006-01-15 10:13:4952--current::
53With this option, the command includes the current
54branch to the list of revs to be shown when it is not
55given on the command line.
56
Junio C Hamano1a4e8412005-12-27 08:17:2357--topo-order::
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).
62
Junio C Hamanocca56612009-06-03 08:27:3363--date-order::
64This option is similar to '--topo-order' in the sense that no
65parent comes before all of its children, but otherwise commits
66are ordered according to their commit date.
67
Junio C Hamano872c5682006-07-07 06:05:4068--sparse::
69By default, the output omits merges that are reachable
70from only one tip being shown. This option makes them
71visible.
72
Junio C Hamano1a4e8412005-12-27 08:17:2373--more=<n>::
74Usually the command stops output upon showing the commit
75that is the common ancestor of all the branches. This
76flag tells the command to go <n> more common commits
77beyond that. When <n> is negative, display only the
78<reference>s given, without showing the commit ancestry
79tree.
80
81--list::
Junio C Hamano38064d52006-01-15 10:13:4982Synonym to `--more=-1`
Junio C Hamano1a4e8412005-12-27 08:17:2383
84--merge-base::
Junio C Hamanofd9274d2009-08-05 21:21:3985Instead of showing the commit list, determine possible
86merge bases for the specified commits. All merge bases
87will be contained in all specified commits. This is
88different from how linkgit:git-merge-base[1] handles
89the case of three or more commits.
Junio C Hamano1a4e8412005-12-27 08:17:2390
91--independent::
92Among the <reference>s given, display only the ones that
93cannot be reached from any other <reference>.
94
95--no-name::
96Do not show naming strings for each commit.
97
98--sha1-name::
99Instead of naming the commits using the path to reach
100them from heads (e.g. "master~2" to mean the grandparent
101of "master"), name them with the unique prefix of their
102object names.
103
Junio C Hamano52401ef2006-12-19 00:54:38104--topics::
105Shows only commits that are NOT on the first branch given.
106This helps track topic branches by hiding any commit that
107is already in the main line of development. When given
108"git show-branch --topics master topic1 topic2", this
109will show the revisions given by "git rev-list {caret}master
110topic1 topic2"
111
Junio C Hamanoa3bb6eb2009-02-05 01:26:33112-g::
Junio C Hamano16cf1582007-02-05 07:21:48113--reflog[=<n>[,<base>]] [<ref>]::
Junio C Hamanodb450ba2007-01-21 08:57:14114Shows <n> most recent ref-log entries for the given
115ref. If <base> is given, <n> entries going back from
Junio C Hamanofa0d4cf2007-01-25 02:23:58116that entry. <base> can be specified as count or date.
Junio C Hamanoa3bb6eb2009-02-05 01:26:33117When no explicit <ref> parameter is given, it defaults to the
Junio C Hamano16cf1582007-02-05 07:21:48118current branch (or `HEAD` if it is detached).
Junio C Hamanod793de52006-12-26 09:11:43119
Junio C Hamano4aa0bcc2010-03-03 05:13:12120--color[=<when>]::
Junio C Hamano52ba2952009-05-18 17:43:02121Color the status sign (one of these: `*` `!` `+` `-`) of each commit
122corresponding to the branch it's in.
Junio C Hamano4aa0bcc2010-03-03 05:13:12123The value must be always (the default), never, or auto.
Junio C Hamano52ba2952009-05-18 17:43:02124
125--no-color::
126Turn off colored output, even when the configuration file gives the
127default to color output.
Junio C Hamano4aa0bcc2010-03-03 05:13:12128Same as `--color=never`.
Junio C Hamano52ba2952009-05-18 17:43:02129
Junio C Hamano1a4e8412005-12-27 08:17:23130Note that --more, --list, --independent and --merge-base options
131are mutually exclusive.
132
133
134OUTPUT
135------
136Given N <references>, the first N lines are the one-line
137description from their commit message. The branch head that is
Junio C Hamano38064d52006-01-15 10:13:49138pointed at by $GIT_DIR/HEAD is prefixed with an asterisk `*`
139character while other heads are prefixed with a `!` character.
Junio C Hamano1a4e8412005-12-27 08:17:23140
141Following these N lines, one-line log for each commit is
142displayed, indented N places. If a commit is on the I-th
Junio C Hamano38064d52006-01-15 10:13:49143branch, the I-th indentation character shows a `+` sign;
144otherwise it shows a space. Merge commits are denoted by
145a `-` sign. Each commit shows a short name that
Junio C Hamano235a91e2006-01-07 01:13:58146can be used as an extended SHA1 to name that commit.
Junio C Hamano1a4e8412005-12-27 08:17:23147
148The following example shows three branches, "master", "fixes"
149and "mhf":
150
151------------------------------------------------
152$ git show-branch master fixes mhf
Junio C Hamano38064d52006-01-15 10:13:49153* [master] Add 'git show-branch'.
Junio C Hamano1a4e8412005-12-27 08:17:23154 ! [fixes] Introduce "reset type" flag to "git reset"
155 ! [mhf] Allow "+remote:local" refspec to cause --force when fetching.
156---
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.
Junio C Hamano38064d52006-01-15 10:13:49167*++ [master] Add 'git show-branch'.
Junio C Hamano1a4e8412005-12-27 08:17:23168------------------------------------------------
169
170These three branches all forked from a common commit, [master],
Junio C Hamanof4581102009-04-25 08:29:59171whose commit message is "Add \'git show-branch\'". The "fixes"
172branch adds one commit "Introduce "reset type" flag to "git reset"".
173The "mhf" branch adds many other commits. The current branch
174is "master".
Junio C Hamano38064d52006-01-15 10:13:49175
176
177EXAMPLE
178-------
179
180If you keep your primary branches immediately under
Junio C Hamano4fdccb22010-02-19 09:58:14181`refs/heads`, and topic branches in subdirectories of
Junio C Hamano38064d52006-01-15 10:13:49182it, having the following in the configuration file may help:
183
184------------
185[showbranch]
186default = --topo-order
187default = heads/*
188
189------------
190
Junio C Hamano2b135272006-03-18 07:45:42191With this, `git show-branch` without extra parameters would show
Junio C Hamano38064d52006-01-15 10:13:49192only the primary branches. In addition, if you happen to be on
193your topic branch, it is shown as well.
194
Junio C Hamanodb450ba2007-01-21 08:57:14195------------
Junio C Hamanof62a11d2008-12-21 12:16:36196$ git show-branch --reflog="10,1 hour ago" --list master
Junio C Hamanodb450ba2007-01-21 08:57:14197------------
198
199shows 10 reflog entries going back from the tip as of 1 hour ago.
200Without `--list`, the output also shows how these tips are
201topologically related with each other.
Junio C Hamano1a4e8412005-12-27 08:17:23202
203
204Author
205------
Junio C Hamano0868a302008-07-22 09:20:44206Written by Junio C Hamano <gitster@pobox.com>
Junio C Hamano1a4e8412005-12-27 08:17:23207
208
209Documentation
210--------------
211Documentation by Junio C Hamano.
212
213
214GIT
215---
Junio C Hamanof7c042d2008-06-06 22:50:53216Part of the linkgit:git[1] suite