blob: 7e9ff3762b111d8740a99b676ea516435018f3a8 [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 Hamanofce7c7e2008-07-02 03:06:3811'git show-branch' [--all] [--remotes] [--topo-order] [--current]
Junio C Hamano2bb13102006-03-06 07:10:2112[--more=<n> | --list | --independent | --merge-base]
Junio C Hamano52401ef2006-12-19 00:54:3813[--no-name | --sha1-name] [--topics] [<rev> | <glob>]...
Junio C Hamanofce7c7e2008-07-02 03:06:3814'git show-branch' (-g|--reflog)[=<n>[,<base>]] [--list] [<ref>]
Junio C Hamano1a4e8412005-12-27 08:17:2315
16DESCRIPTION
17-----------
18
19Shows the commit ancestry graph starting from the commits named
20with <rev>s or <globs>s (or all refs under $GIT_DIR/refs/heads
21and/or $GIT_DIR/refs/tags) semi-visually.
22
23It cannot show more than 29 branches and commits at a time.
24
Junio C Hamano38064d52006-01-15 10:13:4925It uses `showbranch.default` multi-valued configuration items if
26no <rev> nor <glob> is given on the command line.
27
Junio C Hamano1a4e8412005-12-27 08:17:2328
29OPTIONS
30-------
31<rev>::
Junio C Hamanofce7c7e2008-07-02 03:06:3832Arbitrary extended SHA1 expression (see linkgit:git-rev-parse[1])
Junio C Hamano54bf1e22008-12-20 06:30:1133that typically names a branch head or a tag.
Junio C Hamano1a4e8412005-12-27 08:17:2334
35<glob>::
36A glob pattern that matches branch or tag names under
37$GIT_DIR/refs. For example, if you have many topic
38branches under $GIT_DIR/refs/heads/topic, giving
39`topic/*` would show all of them.
40
Junio C Hamanoeb415992008-06-08 22:49:4741-r::
42--remotes::
Junio C Hamano30e1db12006-12-23 10:29:5243Show the remote-tracking branches.
44
Junio C Hamanoeb415992008-06-08 22:49:4745-a::
46--all::
Junio C Hamano30e1db12006-12-23 10:29:5247Show both remote-tracking branches and local branches.
Junio C Hamano1a4e8412005-12-27 08:17:2348
Junio C Hamano38064d52006-01-15 10:13:4949--current::
50With this option, the command includes the current
51branch to the list of revs to be shown when it is not
52given on the command line.
53
Junio C Hamano1a4e8412005-12-27 08:17:2354--topo-order::
55 By default, the branches and their commits are shown in
56 reverse chronological order. This option makes them
57 appear in topological order (i.e., descendant commits
58 are shown before their parents).
59
Junio C Hamano872c5682006-07-07 06:05:4060--sparse::
61By default, the output omits merges that are reachable
62from only one tip being shown. This option makes them
63visible.
64
Junio C Hamano1a4e8412005-12-27 08:17:2365--more=<n>::
66Usually the command stops output upon showing the commit
67that is the common ancestor of all the branches. This
68flag tells the command to go <n> more common commits
69beyond that. When <n> is negative, display only the
70<reference>s given, without showing the commit ancestry
71tree.
72
73--list::
Junio C Hamano38064d52006-01-15 10:13:4974Synonym to `--more=-1`
Junio C Hamano1a4e8412005-12-27 08:17:2375
76--merge-base::
77Instead of showing the commit list, just act like the
Junio C Hamanoba4b9282008-07-06 05:20:3178'git-merge-base -a' command, except that it can accept
Junio C Hamano1a4e8412005-12-27 08:17:2379more than two heads.
80
81--independent::
82Among the <reference>s given, display only the ones that
83cannot be reached from any other <reference>.
84
85--no-name::
86Do not show naming strings for each commit.
87
88--sha1-name::
89Instead of naming the commits using the path to reach
90them from heads (e.g. "master~2" to mean the grandparent
91of "master"), name them with the unique prefix of their
92object names.
93
Junio C Hamano52401ef2006-12-19 00:54:3894--topics::
95Shows only commits that are NOT on the first branch given.
96This helps track topic branches by hiding any commit that
97is already in the main line of development. When given
98"git show-branch --topics master topic1 topic2", this
99will show the revisions given by "git rev-list {caret}master
100topic1 topic2"
101
Junio C Hamanoa3bb6eb2009-02-05 01:26:33102-g::
Junio C Hamano16cf1582007-02-05 07:21:48103--reflog[=<n>[,<base>]] [<ref>]::
Junio C Hamanodb450ba2007-01-21 08:57:14104Shows <n> most recent ref-log entries for the given
105ref. If <base> is given, <n> entries going back from
Junio C Hamanofa0d4cf2007-01-25 02:23:58106that entry. <base> can be specified as count or date.
Junio C Hamanoa3bb6eb2009-02-05 01:26:33107When no explicit <ref> parameter is given, it defaults to the
Junio C Hamano16cf1582007-02-05 07:21:48108current branch (or `HEAD` if it is detached).
Junio C Hamanod793de52006-12-26 09:11:43109
Junio C Hamano1a4e8412005-12-27 08:17:23110Note that --more, --list, --independent and --merge-base options
111are mutually exclusive.
112
113
114OUTPUT
115------
116Given N <references>, the first N lines are the one-line
117description from their commit message. The branch head that is
Junio C Hamano38064d52006-01-15 10:13:49118pointed at by $GIT_DIR/HEAD is prefixed with an asterisk `*`
119character while other heads are prefixed with a `!` character.
Junio C Hamano1a4e8412005-12-27 08:17:23120
121Following these N lines, one-line log for each commit is
122displayed, indented N places. If a commit is on the I-th
Junio C Hamano38064d52006-01-15 10:13:49123branch, the I-th indentation character shows a `+` sign;
124otherwise it shows a space. Merge commits are denoted by
125a `-` sign. Each commit shows a short name that
Junio C Hamano235a91e2006-01-07 01:13:58126can be used as an extended SHA1 to name that commit.
Junio C Hamano1a4e8412005-12-27 08:17:23127
128The following example shows three branches, "master", "fixes"
129and "mhf":
130
131------------------------------------------------
132$ git show-branch master fixes mhf
Junio C Hamano38064d52006-01-15 10:13:49133* [master] Add 'git show-branch'.
Junio C Hamano1a4e8412005-12-27 08:17:23134 ! [fixes] Introduce "reset type" flag to "git reset"
135 ! [mhf] Allow "+remote:local" refspec to cause --force when fetching.
136---
137 + [mhf] Allow "+remote:local" refspec to cause --force when fetching.
138 + [mhf~1] Use git-octopus when pulling more than one heads.
139 + [fixes] Introduce "reset type" flag to "git reset"
140 + [mhf~2] "git fetch --force".
141 + [mhf~3] Use .git/remote/origin, not .git/branches/origin.
142 + [mhf~4] Make "git pull" and "git fetch" default to origin
143 + [mhf~5] Infamous 'octopus merge'
144 + [mhf~6] Retire git-parse-remote.
145 + [mhf~7] Multi-head fetch.
146 + [mhf~8] Start adding the $GIT_DIR/remotes/ support.
Junio C Hamano38064d52006-01-15 10:13:49147*++ [master] Add 'git show-branch'.
Junio C Hamano1a4e8412005-12-27 08:17:23148------------------------------------------------
149
150These three branches all forked from a common commit, [master],
151whose commit message is "Add 'git show-branch'. "fixes" branch
152adds one commit 'Introduce "reset type"'. "mhf" branch has many
Junio C Hamano38064d52006-01-15 10:13:49153other commits. The current branch is "master".
154
155
156EXAMPLE
157-------
158
159If you keep your primary branches immediately under
160`$GIT_DIR/refs/heads`, and topic branches in subdirectories of
161it, having the following in the configuration file may help:
162
163------------
164[showbranch]
165default = --topo-order
166default = heads/*
167
168------------
169
Junio C Hamano2b135272006-03-18 07:45:42170With this, `git show-branch` without extra parameters would show
Junio C Hamano38064d52006-01-15 10:13:49171only the primary branches. In addition, if you happen to be on
172your topic branch, it is shown as well.
173
Junio C Hamanodb450ba2007-01-21 08:57:14174------------
Junio C Hamanof62a11d2008-12-21 12:16:36175$ git show-branch --reflog="10,1 hour ago" --list master
Junio C Hamanodb450ba2007-01-21 08:57:14176------------
177
178shows 10 reflog entries going back from the tip as of 1 hour ago.
179Without `--list`, the output also shows how these tips are
180topologically related with each other.
Junio C Hamano1a4e8412005-12-27 08:17:23181
182
183Author
184------
Junio C Hamano0868a302008-07-22 09:20:44185Written by Junio C Hamano <gitster@pobox.com>
Junio C Hamano1a4e8412005-12-27 08:17:23186
187
188Documentation
189--------------
190Documentation by Junio C Hamano.
191
192
193GIT
194---
Junio C Hamanof7c042d2008-06-06 22:50:53195Part of the linkgit:git[1] suite