Documentation / git-show-branch.txton commit GIT v1.5.0 preview (d5e86da)
   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] [--remotes] [--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-r|--remotes::
  41        Show the remote-tracking branches.
  42
  43-a|--all::
  44        Show both remote-tracking branches and local branches.
  45
  46--current::
  47        With this option, the command includes the current
  48        branch to the list of revs to be shown when it is not
  49        given on the command line.
  50
  51--topo-order::
  52        By default, the branches and their commits are shown in
  53        reverse chronological order.  This option makes them
  54        appear in topological order (i.e., descendant commits
  55        are shown before their parents).
  56
  57--sparse::
  58        By default, the output omits merges that are reachable
  59        from only one tip being shown.  This option makes them
  60        visible.
  61
  62--more=<n>::
  63        Usually the command stops output upon showing the commit
  64        that is the common ancestor of all the branches.  This
  65        flag tells the command to go <n> more common commits
  66        beyond that.  When <n> is negative, display only the
  67        <reference>s given, without showing the commit ancestry
  68        tree.
  69
  70--list::
  71        Synonym to `--more=-1`
  72
  73--merge-base::
  74        Instead of showing the commit list, just act like the
  75        'git-merge-base -a' command, except that it can accept
  76        more than two heads.
  77
  78--independent::
  79        Among the <reference>s given, display only the ones that
  80        cannot be reached from any other <reference>.
  81
  82--no-name::
  83        Do not show naming strings for each commit.
  84
  85--sha1-name::
  86        Instead of naming the commits using the path to reach
  87        them from heads (e.g. "master~2" to mean the grandparent
  88        of "master"), name them with the unique prefix of their
  89        object names.
  90
  91--topics::
  92        Shows only commits that are NOT on the first branch given.
  93        This helps track topic branches by hiding any commit that
  94        is already in the main line of development.  When given
  95        "git show-branch --topics master topic1 topic2", this
  96        will show the revisions given by "git rev-list {caret}master
  97        topic1 topic2"
  98
  99Note that --more, --list, --independent and --merge-base options
 100are mutually exclusive.
 101
 102
 103OUTPUT
 104------
 105Given N <references>, the first N lines are the one-line
 106description from their commit message.  The branch head that is
 107pointed at by $GIT_DIR/HEAD is prefixed with an asterisk `*`
 108character while other heads are prefixed with a `!` character.
 109
 110Following these N lines, one-line log for each commit is
 111displayed, indented N places.  If a commit is on the I-th
 112branch, the I-th indentation character shows a `+` sign;
 113otherwise it shows a space.  Merge commits are denoted by
 114a `-` sign.  Each commit shows a short name that
 115can be used as an extended SHA1 to name that commit.
 116
 117The following example shows three branches, "master", "fixes"
 118and "mhf":
 119
 120------------------------------------------------
 121$ git show-branch master fixes mhf
 122* [master] Add 'git show-branch'.
 123 ! [fixes] Introduce "reset type" flag to "git reset"
 124  ! [mhf] Allow "+remote:local" refspec to cause --force when fetching.
 125---
 126  + [mhf] Allow "+remote:local" refspec to cause --force when fetching.
 127  + [mhf~1] Use git-octopus when pulling more than one heads.
 128 +  [fixes] Introduce "reset type" flag to "git reset"
 129  + [mhf~2] "git fetch --force".
 130  + [mhf~3] Use .git/remote/origin, not .git/branches/origin.
 131  + [mhf~4] Make "git pull" and "git fetch" default to origin
 132  + [mhf~5] Infamous 'octopus merge'
 133  + [mhf~6] Retire git-parse-remote.
 134  + [mhf~7] Multi-head fetch.
 135  + [mhf~8] Start adding the $GIT_DIR/remotes/ support.
 136*++ [master] Add 'git show-branch'.
 137------------------------------------------------
 138
 139These three branches all forked from a common commit, [master],
 140whose commit message is "Add 'git show-branch'.  "fixes" branch
 141adds one commit 'Introduce "reset type"'.  "mhf" branch has many
 142other commits.  The current branch is "master".
 143
 144
 145EXAMPLE
 146-------
 147
 148If you keep your primary branches immediately under
 149`$GIT_DIR/refs/heads`, and topic branches in subdirectories of
 150it, having the following in the configuration file may help:
 151
 152------------
 153[showbranch]
 154        default = --topo-order
 155        default = heads/*
 156
 157------------
 158
 159With this, `git show-branch` without extra parameters would show
 160only the primary branches.  In addition, if you happen to be on
 161your topic branch, it is shown as well.
 162
 163
 164
 165Author
 166------
 167Written by Junio C Hamano <junkio@cox.net>
 168
 169
 170Documentation
 171--------------
 172Documentation by Junio C Hamano.
 173
 174
 175GIT
 176---
 177Part of the gitlink:git[7] suite