blob: 0bb8250b202de93bac6b5cef957454cda2648a13 [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 Hamano30e1db12006-12-23 10:29:5211'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 Hamano16cf1582007-02-05 07:21:4814'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>::
32Arbitrary extended SHA1 expression (see `git-rev-parse`)
33that typically names a branch HEAD or a tag.
34
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 Hamano30e1db12006-12-23 10:29:5241-r|--remotes::
42Show the remote-tracking branches.
43
44-a|--all::
45Show both remote-tracking branches and local branches.
Junio C Hamano1a4e8412005-12-27 08:17:2346
Junio C Hamano38064d52006-01-15 10:13:4947--current::
48With this option, the command includes the current
49branch to the list of revs to be shown when it is not
50given on the command line.
51
Junio C Hamano1a4e8412005-12-27 08:17:2352--topo-order::
53 By default, the branches and their commits are shown in
54 reverse chronological order. This option makes them
55 appear in topological order (i.e., descendant commits
56 are shown before their parents).
57
Junio C Hamano872c5682006-07-07 06:05:4058--sparse::
59By default, the output omits merges that are reachable
60from only one tip being shown. This option makes them
61visible.
62
Junio C Hamano1a4e8412005-12-27 08:17:2363--more=<n>::
64Usually the command stops output upon showing the commit
65that is the common ancestor of all the branches. This
66flag tells the command to go <n> more common commits
67beyond that. When <n> is negative, display only the
68<reference>s given, without showing the commit ancestry
69tree.
70
71--list::
Junio C Hamano38064d52006-01-15 10:13:4972Synonym to `--more=-1`
Junio C Hamano1a4e8412005-12-27 08:17:2373
74--merge-base::
75Instead of showing the commit list, just act like the
76'git-merge-base -a' command, except that it can accept
77more than two heads.
78
79--independent::
80Among the <reference>s given, display only the ones that
81cannot be reached from any other <reference>.
82
83--no-name::
84Do not show naming strings for each commit.
85
86--sha1-name::
87Instead of naming the commits using the path to reach
88them from heads (e.g. "master~2" to mean the grandparent
89of "master"), name them with the unique prefix of their
90object names.
91
Junio C Hamano52401ef2006-12-19 00:54:3892--topics::
93Shows only commits that are NOT on the first branch given.
94This helps track topic branches by hiding any commit that
95is already in the main line of development. When given
96"git show-branch --topics master topic1 topic2", this
97will show the revisions given by "git rev-list {caret}master
98topic1 topic2"
99
Junio C Hamano16cf1582007-02-05 07:21:48100--reflog[=<n>[,<base>]] [<ref>]::
Junio C Hamanodb450ba2007-01-21 08:57:14101Shows <n> most recent ref-log entries for the given
102ref. If <base> is given, <n> entries going back from
Junio C Hamanofa0d4cf2007-01-25 02:23:58103that entry. <base> can be specified as count or date.
Junio C Hamano16cf1582007-02-05 07:21:48104`-g` can be used as a short-hand for this option. When
105no explicit <ref> parameter is given, it defaults to the
106current branch (or `HEAD` if it is detached).
Junio C Hamanod793de52006-12-26 09:11:43107
Junio C Hamano1a4e8412005-12-27 08:17:23108Note that --more, --list, --independent and --merge-base options
109are mutually exclusive.
110
111
112OUTPUT
113------
114Given N <references>, the first N lines are the one-line
115description from their commit message. The branch head that is
Junio C Hamano38064d52006-01-15 10:13:49116pointed at by $GIT_DIR/HEAD is prefixed with an asterisk `*`
117character while other heads are prefixed with a `!` character.
Junio C Hamano1a4e8412005-12-27 08:17:23118
119Following these N lines, one-line log for each commit is
120displayed, indented N places. If a commit is on the I-th
Junio C Hamano38064d52006-01-15 10:13:49121branch, the I-th indentation character shows a `+` sign;
122otherwise it shows a space. Merge commits are denoted by
123a `-` sign. Each commit shows a short name that
Junio C Hamano235a91e2006-01-07 01:13:58124can be used as an extended SHA1 to name that commit.
Junio C Hamano1a4e8412005-12-27 08:17:23125
126The following example shows three branches, "master", "fixes"
127and "mhf":
128
129------------------------------------------------
130$ git show-branch master fixes mhf
Junio C Hamano38064d52006-01-15 10:13:49131* [master] Add 'git show-branch'.
Junio C Hamano1a4e8412005-12-27 08:17:23132 ! [fixes] Introduce "reset type" flag to "git reset"
133 ! [mhf] Allow "+remote:local" refspec to cause --force when fetching.
134---
135 + [mhf] Allow "+remote:local" refspec to cause --force when fetching.
136 + [mhf~1] Use git-octopus when pulling more than one heads.
137 + [fixes] Introduce "reset type" flag to "git reset"
138 + [mhf~2] "git fetch --force".
139 + [mhf~3] Use .git/remote/origin, not .git/branches/origin.
140 + [mhf~4] Make "git pull" and "git fetch" default to origin
141 + [mhf~5] Infamous 'octopus merge'
142 + [mhf~6] Retire git-parse-remote.
143 + [mhf~7] Multi-head fetch.
144 + [mhf~8] Start adding the $GIT_DIR/remotes/ support.
Junio C Hamano38064d52006-01-15 10:13:49145*++ [master] Add 'git show-branch'.
Junio C Hamano1a4e8412005-12-27 08:17:23146------------------------------------------------
147
148These three branches all forked from a common commit, [master],
149whose commit message is "Add 'git show-branch'. "fixes" branch
150adds one commit 'Introduce "reset type"'. "mhf" branch has many
Junio C Hamano38064d52006-01-15 10:13:49151other commits. The current branch is "master".
152
153
154EXAMPLE
155-------
156
157If you keep your primary branches immediately under
158`$GIT_DIR/refs/heads`, and topic branches in subdirectories of
159it, having the following in the configuration file may help:
160
161------------
162[showbranch]
163default = --topo-order
164default = heads/*
165
166------------
167
Junio C Hamano2b135272006-03-18 07:45:42168With this, `git show-branch` without extra parameters would show
Junio C Hamano38064d52006-01-15 10:13:49169only the primary branches. In addition, if you happen to be on
170your topic branch, it is shown as well.
171
Junio C Hamanodb450ba2007-01-21 08:57:14172------------
173$ git show-branch --reflog='10,1 hour ago' --list master
174------------
175
176shows 10 reflog entries going back from the tip as of 1 hour ago.
177Without `--list`, the output also shows how these tips are
178topologically related with each other.
Junio C Hamano1a4e8412005-12-27 08:17:23179
180
181Author
182------
183Written by Junio C Hamano <junkio@cox.net>
184
185
186Documentation
187--------------
188Documentation by Junio C Hamano.
189
190
191GIT
192---
Junio C Hamano35738e82008-01-07 07:55:46193Part of the linkgit:git[7] suite