Documentation: refer to gitworkflows(7) from tutorial and git(1)
[git/dscho.git] / Documentation / git-show-branch.txt
blob51a4e9d6d767f34205f418ec86a6281dbf4c7b2c
1 git-show-branch(1)
2 ==================
4 NAME
5 ----
6 git-show-branch - Show branches and their commits
8 SYNOPSIS
9 --------
10 [verse]
11 'git show-branch' [--all] [--remotes] [--topo-order] [--current]
12                 [--more=<n> | --list | --independent | --merge-base]
13                 [--no-name | --sha1-name] [--topics] [<rev> | <glob>]...
14 'git show-branch' (-g|--reflog)[=<n>[,<base>]] [--list] [<ref>]
16 DESCRIPTION
17 -----------
19 Shows the commit ancestry graph starting from the commits named
20 with <rev>s or <globs>s (or all refs under $GIT_DIR/refs/heads
21 and/or $GIT_DIR/refs/tags) semi-visually.
23 It cannot show more than 29 branches and commits at a time.
25 It uses `showbranch.default` multi-valued configuration items if
26 no <rev> nor <glob> is given on the command line.
29 OPTIONS
30 -------
31 <rev>::
32         Arbitrary extended SHA1 expression (see linkgit:git-rev-parse[1])
33         that typically names a branch head or a tag.
35 <glob>::
36         A glob pattern that matches branch or tag names under
37         $GIT_DIR/refs.  For example, if you have many topic
38         branches under $GIT_DIR/refs/heads/topic, giving
39         `topic/*` would show all of them.
41 -r::
42 --remotes::
43         Show the remote-tracking branches.
45 -a::
46 --all::
47         Show both remote-tracking branches and local branches.
49 --current::
50         With this option, the command includes the current
51         branch to the list of revs to be shown when it is not
52         given on the command line.
54 --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).
60 --sparse::
61         By default, the output omits merges that are reachable
62         from only one tip being shown.  This option makes them
63         visible.
65 --more=<n>::
66         Usually the command stops output upon showing the commit
67         that is the common ancestor of all the branches.  This
68         flag tells the command to go <n> more common commits
69         beyond that.  When <n> is negative, display only the
70         <reference>s given, without showing the commit ancestry
71         tree.
73 --list::
74         Synonym to `--more=-1`
76 --merge-base::
77         Instead of showing the commit list, just act like the
78         'git-merge-base -a' command, except that it can accept
79         more than two heads.
81 --independent::
82         Among the <reference>s given, display only the ones that
83         cannot be reached from any other <reference>.
85 --no-name::
86         Do not show naming strings for each commit.
88 --sha1-name::
89         Instead of naming the commits using the path to reach
90         them from heads (e.g. "master~2" to mean the grandparent
91         of "master"), name them with the unique prefix of their
92         object names.
94 --topics::
95         Shows only commits that are NOT on the first branch given.
96         This helps track topic branches by hiding any commit that
97         is already in the main line of development.  When given
98         "git show-branch --topics master topic1 topic2", this
99         will show the revisions given by "git rev-list {caret}master
100         topic1 topic2"
102 -g::
103 --reflog[=<n>[,<base>]] [<ref>]::
104         Shows <n> most recent ref-log entries for the given
105         ref.  If <base> is given, <n> entries going back from
106         that entry.  <base> can be specified as count or date.
107         When no explicit <ref> parameter is given, it defaults to the
108         current branch (or `HEAD` if it is detached).
110 Note that --more, --list, --independent and --merge-base options
111 are mutually exclusive.
114 OUTPUT
115 ------
116 Given N <references>, the first N lines are the one-line
117 description from their commit message.  The branch head that is
118 pointed at by $GIT_DIR/HEAD is prefixed with an asterisk `*`
119 character while other heads are prefixed with a `!` character.
121 Following these N lines, one-line log for each commit is
122 displayed, indented N places.  If a commit is on the I-th
123 branch, the I-th indentation character shows a `+` sign;
124 otherwise it shows a space.  Merge commits are denoted by
125 a `-` sign.  Each commit shows a short name that
126 can be used as an extended SHA1 to name that commit.
128 The following example shows three branches, "master", "fixes"
129 and "mhf":
131 ------------------------------------------------
132 $ git show-branch master fixes mhf
133 * [master] Add 'git show-branch'.
134  ! [fixes] Introduce "reset type" flag to "git reset"
135   ! [mhf] Allow "+remote:local" refspec to cause --force when fetching.
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.
147 *++ [master] Add 'git show-branch'.
148 ------------------------------------------------
150 These three branches all forked from a common commit, [master],
151 whose commit message is "Add \'git show-branch\'". The "fixes"
152 branch adds one commit "Introduce "reset type" flag to "git reset"".
153 The "mhf" branch adds many other commits. The current branch
154 is "master".
157 EXAMPLE
158 -------
160 If you keep your primary branches immediately under
161 `$GIT_DIR/refs/heads`, and topic branches in subdirectories of
162 it, having the following in the configuration file may help:
164 ------------
165 [showbranch]
166         default = --topo-order
167         default = heads/*
169 ------------
171 With this, `git show-branch` without extra parameters would show
172 only the primary branches.  In addition, if you happen to be on
173 your topic branch, it is shown as well.
175 ------------
176 $ git show-branch --reflog="10,1 hour ago" --list master
177 ------------
179 shows 10 reflog entries going back from the tip as of 1 hour ago.
180 Without `--list`, the output also shows how these tips are
181 topologically related with each other.
184 Author
185 ------
186 Written by Junio C Hamano <gitster@pobox.com>
189 Documentation
190 --------------
191 Documentation by Junio C Hamano.
196 Part of the linkgit:git[1] suite