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] [<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--more=<n>:: 56 Usually the command stops output upon showing the commit 57 that is the common ancestor of all the branches. This 58 flag tells the command to go <n> more common commits 59 beyond that. When <n> is negative, display only the 60 <reference>s given, without showing the commit ancestry 61 tree. 62 63--list:: 64 Synonym to `--more=-1` 65 66--merge-base:: 67 Instead of showing the commit list, just act like the 68 'git-merge-base -a' command, except that it can accept 69 more than two heads. 70 71--independent:: 72 Among the <reference>s given, display only the ones that 73 cannot be reached from any other <reference>. 74 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 84Note that --more, --list, --independent and --merge-base options 85are mutually exclusive. 86 87 88OUTPUT 89------ 90Given N <references>, the first N lines are the one-line 91description from their commit message. The branch head that is 92pointed at by $GIT_DIR/HEAD is prefixed with an asterisk `*` 93character while other heads are prefixed with a `!` character. 94 95Following these N lines, one-line log for each commit is 96displayed, indented N places. If a commit is on the I-th 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 100can be used as an extended SHA1 to name that commit. 101 102The following example shows three branches, "master", "fixes" 103and "mhf": 104 105------------------------------------------------ 106$ git show-branch master fixes mhf 107* [master] Add 'git show-branch'. 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. 121*++ [master] Add 'git show-branch'. 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 127other commits. The current branch is "master". 128 129 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 144With this,`git show-branch` without extra parameters would show 145only the primary branches. In addition, if you happen to be on 146your topic branch, it is shown as well. 147 148 149 150Author 151------ 152Written by Junio C Hamano <junkio@cox.net> 153 154 155Documentation 156-------------- 157Documentation by Junio C Hamano. 158 159 160GIT 161--- 162Part of the gitlink:git[7] suite