blob: 734336119c6b1f7ea8241f0404eaa3ba2ae10f69 [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]
12[--current] [--color | --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
23with <rev>s or <globs>s (or all refs under $GIT_DIR/refs/heads
24and/or $GIT_DIR/refs/tags) semi-visually.
25
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
40$GIT_DIR/refs. For example, if you have many topic
41branches under $GIT_DIR/refs/heads/topic, giving
42`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 Hamano52ba2952009-05-18 17:43:02120--color::
121Color the status sign (one of these: `*` `!` `+` `-`) of each commit
122corresponding to the branch it's in.
123
124--no-color::
125Turn off colored output, even when the configuration file gives the
126default to color output.
127
Junio C Hamano1a4e8412005-12-27 08:17:23128Note that --more, --list, --independent and --merge-base options
129are mutually exclusive.
130
131
132OUTPUT
133------
134Given N <references>, the first N lines are the one-line
135description from their commit message. The branch head that is
Junio C Hamano38064d52006-01-15 10:13:49136pointed at by $GIT_DIR/HEAD is prefixed with an asterisk `*`
137character while other heads are prefixed with a `!` character.
Junio C Hamano1a4e8412005-12-27 08:17:23138
139Following these N lines, one-line log for each commit is
140displayed, indented N places. If a commit is on the I-th
Junio C Hamano38064d52006-01-15 10:13:49141branch, the I-th indentation character shows a `+` sign;
142otherwise it shows a space. Merge commits are denoted by
143a `-` sign. Each commit shows a short name that
Junio C Hamano235a91e2006-01-07 01:13:58144can be used as an extended SHA1 to name that commit.
Junio C Hamano1a4e8412005-12-27 08:17:23145
146The following example shows three branches, "master", "fixes"
147and "mhf":
148
149------------------------------------------------
150$ git show-branch master fixes mhf
Junio C Hamano38064d52006-01-15 10:13:49151* [master] Add 'git show-branch'.
Junio C Hamano1a4e8412005-12-27 08:17:23152 ! [fixes] Introduce "reset type" flag to "git reset"
153 ! [mhf] Allow "+remote:local" refspec to cause --force when fetching.
154---
155 + [mhf] Allow "+remote:local" refspec to cause --force when fetching.
156 + [mhf~1] Use git-octopus when pulling more than one heads.
157 + [fixes] Introduce "reset type" flag to "git reset"
158 + [mhf~2] "git fetch --force".
159 + [mhf~3] Use .git/remote/origin, not .git/branches/origin.
160 + [mhf~4] Make "git pull" and "git fetch" default to origin
161 + [mhf~5] Infamous 'octopus merge'
162 + [mhf~6] Retire git-parse-remote.
163 + [mhf~7] Multi-head fetch.
164 + [mhf~8] Start adding the $GIT_DIR/remotes/ support.
Junio C Hamano38064d52006-01-15 10:13:49165*++ [master] Add 'git show-branch'.
Junio C Hamano1a4e8412005-12-27 08:17:23166------------------------------------------------
167
168These three branches all forked from a common commit, [master],
Junio C Hamanof4581102009-04-25 08:29:59169whose commit message is "Add \'git show-branch\'". The "fixes"
170branch adds one commit "Introduce "reset type" flag to "git reset"".
171The "mhf" branch adds many other commits. The current branch
172is "master".
Junio C Hamano38064d52006-01-15 10:13:49173
174
175EXAMPLE
176-------
177
178If you keep your primary branches immediately under
179`$GIT_DIR/refs/heads`, and topic branches in subdirectories of
180it, having the following in the configuration file may help:
181
182------------
183[showbranch]
184default = --topo-order
185default = heads/*
186
187------------
188
Junio C Hamano2b135272006-03-18 07:45:42189With this, `git show-branch` without extra parameters would show
Junio C Hamano38064d52006-01-15 10:13:49190only the primary branches. In addition, if you happen to be on
191your topic branch, it is shown as well.
192
Junio C Hamanodb450ba2007-01-21 08:57:14193------------
Junio C Hamanof62a11d2008-12-21 12:16:36194$ git show-branch --reflog="10,1 hour ago" --list master
Junio C Hamanodb450ba2007-01-21 08:57:14195------------
196
197shows 10 reflog entries going back from the tip as of 1 hour ago.
198Without `--list`, the output also shows how these tips are
199topologically related with each other.
Junio C Hamano1a4e8412005-12-27 08:17:23200
201
202Author
203------
Junio C Hamano0868a302008-07-22 09:20:44204Written by Junio C Hamano <gitster@pobox.com>
Junio C Hamano1a4e8412005-12-27 08:17:23205
206
207Documentation
208--------------
209Documentation by Junio C Hamano.
210
211
212GIT
213---
Junio C Hamanof7c042d2008-06-06 22:50:53214Part of the linkgit:git[1] suite