GIT-SHOW-BRANCH(1)
β¨ GIT-SHOW-BRANCH(1) β¨
Bestie, welcome to the Git Manual page for git-show-branch(1) β yes, the GIT-SHOW-BRANCH(1) one β where we show branches and their commits with full group-chat energy. Facts stay exactly where they are, vibes are upgraded. π«Ά
π NAME π
git-show-branch β Show branches and their commits
πΈ SYNOPSIS πΈ
git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]
[--current] [--color[=<when>] | --no-color] [--sparse]
[--more=<n> | --list | --independent | --merge-base]
[--no-name | --sha1-name] [--topics]
[(<rev> | <glob>)...]
git show-branch (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]
π¦ DESCRIPTION π¦
Okay so git-show-branch shows the commit ancestry graph starting from the commits named with <rev>s or <glob>s (or all refs under refs/heads and/or refs/tags) semi-visually. Itβs giving graph but make it fashion. β¨
Vibe check: it cannot show more than 26 branches and commits at a time. Literally a hard limit, no cap. π
And if you donβt give it a <rev> or <glob> on the command line, it uses showbranch.default multi-valued configuration items. Yes, thatβs the config name in this part β keep it exactly as written, iykyk. π
π OPTIONS π
<rev>β An arbitrary extended SHA-1 expression (seegitrevisions(7)) that typically names a branch head or a tag. π·οΈ<glob>β A glob pattern that matches branch or tag names underrefs/. For example, if you have many topic branches underrefs/heads/topic, givingtopic/*would show all of them. π-r,--remotesβ Show the remote-tracking branches. π°οΈ-a,--allβ Show both remote-tracking branches and local branches. π--currentβ With this option, the command includes the current branch in the list of revs to be shown when it is not given on the command line. π--topo-orderβ By default, the branches and their commits are shown in reverse chronological order. This option makes them appear in topological order (i.e., descendant commits are shown before their parents). π§¬--date-orderβ This option is similar to--topo-orderin the sense that no parent comes before all of its children, but otherwise commits are ordered according to their commit date. π--sparseβ By default, the output omits merges that are reachable from only one tip being shown. This option makes them visible. π--more=<n>β Usually the command stops output upon showing the commit that is the common ancestor of all the branches. This flag tells the command to go<n>more common commits beyond that. When<n>is negative, display only the<ref>s given, without showing the commit ancestry tree. π₯--listβ Synonym to--more=-1. π«Ά--merge-baseβ Instead of showing the commit list, determine possible merge bases for the specified commits. All merge bases will be contained in all specified commits. This is different from howgit-merge-base(1)handles the case of three or more commits. π§--independentβ Among the<ref>s given, display only the ones that cannot be reached from any other<ref>. π--no-nameβ Do not show naming strings for each commit. π--sha1-nameβ Instead of naming the commits using the path to reach them from heads (e.g."master~2"to mean the grandparent of"master"), name them with the unique prefix of their object names. π’--topicsβ Shows only commits that are NOT on the first branch given. This helps track topic branches by hiding any commit that is already in the main line of development. When givengit show-branch --topics master topic1 topic2, this will show the revisions given bygit rev-list ^master topic1 topic2. π§΅-g,--reflog[=<n>[,<base>]] [<ref>]β Shows<n>most recent ref-log entries for the given ref. If<base>is given,<n>entries going back from that entry.<base>can be specified as count or date. When no explicit<ref>parameter is given, it defaults to the current branch (orHEADif it is detached). π°οΈ--color[=<when>]β Color the status sign (one of these:* ! + -) of each commit corresponding to the branch itβs in. The value must bealways(the default),never, orauto. π¨--no-colorβ Turn off colored output, even when the configuration file gives the default to color output. Same as--color=never. π«
Heads up, bestie:--more,--list,--independent, and--merge-baseoptions are mutually exclusive. Pick your fave, not all four. π
π― OUTPUT π―
Given N <ref>s, the first N lines are the one-line description from their commit message. The branch head that is pointed at by $GIT_DIR/HEAD is prefixed with an asterisk * character while other heads are prefixed with a ! character. π
Following these N lines, a one-line log for each commit is displayed, indented N places. If a commit is on the I-th branch, the I-th indentation character shows a + sign; otherwise it shows a space. Merge commits are denoted by a - sign. Each commit shows a short name that can be used as an extended SHA-1 to name that commit. π§
Example time, and yes this is literally the example from the page β copied exact, no edits:
$ git show-branch master fixes mhf
* [master] Add 'git show-branch'.
! [fixes] Introduce "reset type" flag to "git reset"
! [mhf] Allow "+remote:local" refspec to cause --force when fetching.
---
+ [mhf] Allow "+remote:local" refspec to cause --force when fetching.
+ [mhf~1] Use git-octopus when pulling more than one head.
+ [fixes] Introduce "reset type" flag to "git reset"
+ [mhf~2] "git fetch --force".
+ [mhf~3] Use .git/remote/origin, not .git/branches/origin.
+ [mhf~4] Make "git pull" and "git fetch" default to origin
+ [mhf~5] Infamous 'octopus merge'
+ [mhf~6] Retire git-parse-remote.
+ [mhf~7] Multi-head fetch.
+ [mhf~8] Start adding the $GIT_DIR/remotes/ support.
*++ [master] Add 'git show-branch'.
These three branches all forked from a common commit, [master], whose commit message is Add 'git show-branch'. The fixes branch adds one commit Introduce "reset type" flag to "git reset". The mhf branch adds many other commits. The current branch is master. π
π¦ EXAMPLES π¦
If you keep your primary branches immediately under refs/heads, and topic branches in subdirectories of it, having the following in the configuration file may help:
[showbranch]
default = --topo-order
default = heads/*
With this, git show-branch without extra parameters would show only the primary branches. In addition, if you happen to be on your topic branch, it is shown as well. πΈ
$ git show-branch --reflog="10,1 hour ago" --list master
shows 10 reflog entries going back from the tip as of 1 hour ago. Without --list, the output also shows how these tips are topologically related to each other. β
π CONFIGURATION π
Everything below this line in this section is selectively included from the git-config(1) documentation. The content is the same as whatβs found there:
showBranch.defaultβ The default set of branches forgit-show-branch(1). Seegit-show-branch(1). π«Ά
π GIT π
Part of the git(1) suite. π
π Thatβs the whole GIT-SHOW-BRANCH(1) page, bestie β brought to you by Git 2.56.0, dated 2026-09-27. Stay iconic, and may your terminal always vibe. π
π¦ where this page comes from
- arch rolling: git 2.56.0-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms