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