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