1git-show-branch(1) 2================== 3 4NAME 5---- 6git-show-branch - Show branches and their commits 7 8SYNOPSIS 9-------- 10[verse] 11'git-show-branch' [--all] [--heads] [--tags] [--topo-order] [--current] 12 [--more=<n> | --list | --independent | --merge-base] 13 [--no-name | --sha1-name] [--topics] [<rev> | <glob>]... 14 15DESCRIPTION 16----------- 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 24It uses `showbranch.default` multi-valued configuration items if 25no <rev> nor <glob> is given on the command line. 26 27 28OPTIONS 29------- 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. 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 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 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 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 60--more=<n>:: 61 Usually the command stops output upon showing the commit 62 that is the common ancestor of all the branches. This 63 flag tells the command to go <n> more common commits 64 beyond that. When <n> is negative, display only the 65 <reference>s given, without showing the commit ancestry 66 tree. 67 68--list:: 69 Synonym to `--more=-1` 70 71--merge-base:: 72 Instead of showing the commit list, just act like the 73 'git-merge-base -a' command, except that it can accept 74 more than two heads. 75 76--independent:: 77 Among the <reference>s given, display only the ones that 78 cannot be reached from any other <reference>. 79 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 89--topics:: 90 Shows only commits that are NOT on the first branch given. 91 This helps track topic branches by hiding any commit that 92 is already in the main line of development. When given 93 "git show-branch --topics master topic1 topic2", this 94 will show the revisions given by "git rev-list {caret}master 95 topic1 topic2" 96 97Note that --more, --list, --independent and --merge-base options 98are mutually exclusive. 99 100 101OUTPUT 102------ 103Given N <references>, the first N lines are the one-line 104description from their commit message. The branch head that is 105pointed at by $GIT_DIR/HEAD is prefixed with an asterisk `*` 106character while other heads are prefixed with a `!` character. 107 108Following these N lines, one-line log for each commit is 109displayed, indented N places. If a commit is on the I-th 110branch, the I-th indentation character shows a `+` sign; 111otherwise it shows a space. Merge commits are denoted by 112a `-` sign. Each commit shows a short name that 113can be used as an extended SHA1 to name that commit. 114 115The following example shows three branches, "master", "fixes" 116and "mhf": 117 118------------------------------------------------ 119$ git show-branch master fixes mhf 120* [master] Add 'git show-branch'. 121 ! [fixes] Introduce "reset type" flag to "git reset" 122 ! [mhf] Allow "+remote:local" refspec to cause --force when fetching. 123--- 124 + [mhf] Allow "+remote:local" refspec to cause --force when fetching. 125 + [mhf~1] Use git-octopus when pulling more than one heads. 126 + [fixes] Introduce "reset type" flag to "git reset" 127 + [mhf~2] "git fetch --force". 128 + [mhf~3] Use .git/remote/origin, not .git/branches/origin. 129 + [mhf~4] Make "git pull" and "git fetch" default to origin 130 + [mhf~5] Infamous 'octopus merge' 131 + [mhf~6] Retire git-parse-remote. 132 + [mhf~7] Multi-head fetch. 133 + [mhf~8] Start adding the $GIT_DIR/remotes/ support. 134*++ [master] Add 'git show-branch'. 135------------------------------------------------ 136 137These three branches all forked from a common commit, [master], 138whose commit message is "Add 'git show-branch'. "fixes" branch 139adds one commit 'Introduce "reset type"'. "mhf" branch has many 140other commits. The current branch is "master". 141 142 143EXAMPLE 144------- 145 146If you keep your primary branches immediately under 147`$GIT_DIR/refs/heads`, and topic branches in subdirectories of 148it, having the following in the configuration file may help: 149 150------------ 151[showbranch] 152 default = --topo-order 153 default = heads/* 154 155------------ 156 157With this, `git show-branch` without extra parameters would show 158only the primary branches. In addition, if you happen to be on 159your topic branch, it is shown as well. 160 161 162 163Author 164------ 165Written by Junio C Hamano <junkio@cox.net> 166 167 168Documentation 169-------------- 170Documentation by Junio C Hamano. 171 172 173GIT 174--- 175Part of the gitlink:git[7] suite