]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-show-branch.txt
Merge branch 'js/merge-base'
[thirdparty/git.git] / Documentation / git-show-branch.txt
CommitLineData
f5e375c9
JH
1git-show-branch(1)
2==================
f5e375c9
JH
3
4NAME
5----
7bd7f280 6git-show-branch - Show branches and their commits
f5e375c9
JH
7
8SYNOPSIS
9--------
1aa68d67 10[verse]
bd494fc7
DL
11'git-show-branch' [--all] [--heads] [--tags] [--topo-order] [--current]
12 [--more=<n> | --list | --independent | --merge-base]
13 [--no-name | --sha1-name] [<rev> | <glob>]...
f5e375c9
JH
14
15DESCRIPTION
16-----------
287f8600
JH
17
18Shows the commit ancestry graph starting from the commits named
19with <rev>s or <globs>s (or all refs under $GIT_DIR/refs/heads
20and/or $GIT_DIR/refs/tags) semi-visually.
21
22It cannot show more than 29 branches and commits at a time.
23
54f9734e
JH
24It uses `showbranch.default` multi-valued configuration items if
25no <rev> nor <glob> is given on the command line.
26
f5e375c9
JH
27
28OPTIONS
29-------
287f8600
JH
30<rev>::
31 Arbitrary extended SHA1 expression (see `git-rev-parse`)
32 that typically names a branch HEAD or a tag.
33
34<glob>::
35 A glob pattern that matches branch or tag names under
36 $GIT_DIR/refs. For example, if you have many topic
37 branches under $GIT_DIR/refs/heads/topic, giving
38 `topic/*` would show all of them.
f5e375c9
JH
39
40--all --heads --tags::
41 Show all refs under $GIT_DIR/refs, $GIT_DIR/refs/heads,
42 and $GIT_DIR/refs/tags, respectively.
43
1aa68d67
JH
44--current::
45 With this option, the command includes the current
46 branch to the list of revs to be shown when it is not
47 given on the command line.
48
d4ce5f7e
NW
49--topo-order::
50 By default, the branches and their commits are shown in
51 reverse chronological order. This option makes them
52 appear in topological order (i.e., descendant commits
53 are shown before their parents).
54
f5e375c9
JH
55--more=<n>::
56 Usually the command stops output upon showing the commit
57 that is the common ancestor of all the branches. This
f85a4191 58 flag tells the command to go <n> more common commits
1f8af483
JH
59 beyond that. When <n> is negative, display only the
60 <reference>s given, without showing the commit ancestry
61 tree.
62
63--list::
54f9734e 64 Synonym to `--more=-1`
f5e375c9
JH
65
66--merge-base::
67 Instead of showing the commit list, just act like the
2f0f8b71
JH
68 'git-merge-base -a' command, except that it can accept
69 more than two heads.
f5e375c9 70
1f8af483
JH
71--independent::
72 Among the <reference>s given, display only the ones that
73 cannot be reached from any other <reference>.
74
013f276e
JH
75--no-name::
76 Do not show naming strings for each commit.
77
78--sha1-name::
79 Instead of naming the commits using the path to reach
80 them from heads (e.g. "master~2" to mean the grandparent
81 of "master"), name them with the unique prefix of their
82 object names.
83
1f8af483
JH
84Note that --more, --list, --independent and --merge-base options
85are mutually exclusive.
86
f5e375c9
JH
87
88OUTPUT
89------
90Given N <references>, the first N lines are the one-line
91description from their commit message. The branch head that is
ebedc319
JH
92pointed at by $GIT_DIR/HEAD is prefixed with an asterisk `*`
93character while other heads are prefixed with a `!` character.
f5e375c9
JH
94
95Following these N lines, one-line log for each commit is
96displayed, indented N places. If a commit is on the I-th
ebedc319
JH
97branch, the I-th indentation character shows a `+` sign;
98otherwise it shows a space. Merge commits are denoted by
99a `-` sign. Each commit shows a short name that
89438677 100can be used as an extended SHA1 to name that commit.
f5e375c9
JH
101
102The following example shows three branches, "master", "fixes"
103and "mhf":
104
105------------------------------------------------
106$ git show-branch master fixes mhf
ebedc319 107* [master] Add 'git show-branch'.
f5e375c9
JH
108 ! [fixes] Introduce "reset type" flag to "git reset"
109 ! [mhf] Allow "+remote:local" refspec to cause --force when fetching.
110---
111 + [mhf] Allow "+remote:local" refspec to cause --force when fetching.
112 + [mhf~1] Use git-octopus when pulling more than one heads.
113 + [fixes] Introduce "reset type" flag to "git reset"
114 + [mhf~2] "git fetch --force".
115 + [mhf~3] Use .git/remote/origin, not .git/branches/origin.
116 + [mhf~4] Make "git pull" and "git fetch" default to origin
117 + [mhf~5] Infamous 'octopus merge'
118 + [mhf~6] Retire git-parse-remote.
119 + [mhf~7] Multi-head fetch.
120 + [mhf~8] Start adding the $GIT_DIR/remotes/ support.
ebedc319 121*++ [master] Add 'git show-branch'.
f5e375c9
JH
122------------------------------------------------
123
124These three branches all forked from a common commit, [master],
125whose commit message is "Add 'git show-branch'. "fixes" branch
126adds one commit 'Introduce "reset type"'. "mhf" branch has many
ebedc319 127other commits. The current branch is "master".
f5e375c9 128
f5e375c9 129
54f9734e
JH
130EXAMPLE
131-------
132
133If you keep your primary branches immediately under
134`$GIT_DIR/refs/heads`, and topic branches in subdirectories of
135it, having the following in the configuration file may help:
136
137------------
138[showbranch]
139 default = --topo-order
140 default = heads/*
141
142------------
143
beb8e134 144With this, `git show-branch` without extra parameters would show
1aa68d67
JH
145only the primary branches. In addition, if you happen to be on
146your topic branch, it is shown as well.
54f9734e
JH
147
148
149
f5e375c9
JH
150Author
151------
152Written by Junio C Hamano <junkio@cox.net>
153
154
155Documentation
156--------------
157Documentation by Junio C Hamano.
158
159
160GIT
161---
a7154e91 162Part of the gitlink:git[7] suite