logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

git-show-branch.1 (8560B)


  1. '\" t
  2. .\" Title: git-show-branch
  3. .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
  5. .\" Date: 2025-03-14
  6. .\" Manual: Git Manual
  7. .\" Source: Git 2.49.0
  8. .\" Language: English
  9. .\"
  10. .TH "GIT\-SHOW\-BRANCH" "1" "2025-03-14" "Git 2\&.49\&.0" "Git Manual"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. git-show-branch \- Show branches and their commits
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit show\-branch\fR [\-a | \-\-all] [\-r | \-\-remotes] [\-\-topo\-order | \-\-date\-order]
  36. [\-\-current] [\-\-color[=<when>] | \-\-no\-color] [\-\-sparse]
  37. [\-\-more=<n> | \-\-list | \-\-independent | \-\-merge\-base]
  38. [\-\-no\-name | \-\-sha1\-name] [\-\-topics]
  39. [(<rev> | <glob>)\&...\:]
  40. \fIgit show\-branch\fR (\-g | \-\-reflog)[=<n>[,<base>]] [\-\-list] [<ref>]
  41. .fi
  42. .SH "DESCRIPTION"
  43. .sp
  44. 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\&.
  45. .sp
  46. It cannot show more than 26 branches and commits at a time\&.
  47. .sp
  48. It uses \fBshowbranch\&.default\fR multi\-valued configuration items if no <rev> or <glob> is given on the command line\&.
  49. .SH "OPTIONS"
  50. .PP
  51. <rev>
  52. .RS 4
  53. Arbitrary extended SHA\-1 expression (see
  54. \fBgitrevisions\fR(7)) that typically names a branch head or a tag\&.
  55. .RE
  56. .PP
  57. <glob>
  58. .RS 4
  59. A glob pattern that matches branch or tag names under refs/\&. For example, if you have many topic branches under refs/heads/topic, giving
  60. \fBtopic/\fR* would show all of them\&.
  61. .RE
  62. .PP
  63. \-r, \-\-remotes
  64. .RS 4
  65. Show the remote\-tracking branches\&.
  66. .RE
  67. .PP
  68. \-a, \-\-all
  69. .RS 4
  70. Show both remote\-tracking branches and local branches\&.
  71. .RE
  72. .PP
  73. \-\-current
  74. .RS 4
  75. 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\&.
  76. .RE
  77. .PP
  78. \-\-topo\-order
  79. .RS 4
  80. 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)\&.
  81. .RE
  82. .PP
  83. \-\-date\-order
  84. .RS 4
  85. This option is similar to
  86. \fB\-\-topo\-order\fR
  87. in the sense that no parent comes before all of its children, but otherwise commits are ordered according to their commit date\&.
  88. .RE
  89. .PP
  90. \-\-sparse
  91. .RS 4
  92. By default, the output omits merges that are reachable from only one tip being shown\&. This option makes them visible\&.
  93. .RE
  94. .PP
  95. \-\-more=<n>
  96. .RS 4
  97. 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\&.
  98. .RE
  99. .PP
  100. \-\-list
  101. .RS 4
  102. Synonym to
  103. \fB\-\-more=\-1\fR
  104. .RE
  105. .PP
  106. \-\-merge\-base
  107. .RS 4
  108. 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 how
  109. \fBgit-merge-base\fR(1)
  110. handles the case of three or more commits\&.
  111. .RE
  112. .PP
  113. \-\-independent
  114. .RS 4
  115. Among the <ref>s given, display only the ones that cannot be reached from any other <ref>\&.
  116. .RE
  117. .PP
  118. \-\-no\-name
  119. .RS 4
  120. Do not show naming strings for each commit\&.
  121. .RE
  122. .PP
  123. \-\-sha1\-name
  124. .RS 4
  125. 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\&.
  126. .RE
  127. .PP
  128. \-\-topics
  129. .RS 4
  130. 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 given "git show\-branch \-\-topics master topic1 topic2", this will show the revisions given by "git rev\-list ^master topic1 topic2"
  131. .RE
  132. .PP
  133. \-g, \-\-reflog[=<n>[,<base>]] [<ref>]
  134. .RS 4
  135. 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 (or
  136. \fBHEAD\fR
  137. if it is detached)\&.
  138. .RE
  139. .PP
  140. \-\-color[=<when>]
  141. .RS 4
  142. Color the status sign (one of these: * !
  143. \fB+\fR
  144. \fB\-\fR) of each commit corresponding to the branch it\(cqs in\&. The value must be always (the default), never, or auto\&.
  145. .RE
  146. .PP
  147. \-\-no\-color
  148. .RS 4
  149. Turn off colored output, even when the configuration file gives the default to color output\&. Same as
  150. \fB\-\-color=never\fR\&.
  151. .RE
  152. .sp
  153. Note that \-\-more, \-\-list, \-\-independent, and \-\-merge\-base options are mutually exclusive\&.
  154. .SH "OUTPUT"
  155. .sp
  156. 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\&.
  157. .sp
  158. 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 \fB+\fR sign; otherwise it shows a space\&. Merge commits are denoted by a \fB\-\fR sign\&. Each commit shows a short name that can be used as an extended SHA\-1 to name that commit\&.
  159. .sp
  160. The following example shows three branches, "master", "fixes", and "mhf":
  161. .sp
  162. .if n \{\
  163. .RS 4
  164. .\}
  165. .nf
  166. $ git show\-branch master fixes mhf
  167. * [master] Add \*(Aqgit show\-branch\*(Aq\&.
  168. ! [fixes] Introduce "reset type" flag to "git reset"
  169. ! [mhf] Allow "+remote:local" refspec to cause \-\-force when fetching\&.
  170. \-\-\-
  171. + [mhf] Allow "+remote:local" refspec to cause \-\-force when fetching\&.
  172. + [mhf~1] Use git\-octopus when pulling more than one head\&.
  173. + [fixes] Introduce "reset type" flag to "git reset"
  174. + [mhf~2] "git fetch \-\-force"\&.
  175. + [mhf~3] Use \&.git/remote/origin, not \&.git/branches/origin\&.
  176. + [mhf~4] Make "git pull" and "git fetch" default to origin
  177. + [mhf~5] Infamous \*(Aqoctopus merge\*(Aq
  178. + [mhf~6] Retire git\-parse\-remote\&.
  179. + [mhf~7] Multi\-head fetch\&.
  180. + [mhf~8] Start adding the $GIT_DIR/remotes/ support\&.
  181. *++ [master] Add \*(Aqgit show\-branch\*(Aq\&.
  182. .fi
  183. .if n \{\
  184. .RE
  185. .\}
  186. .sp
  187. These three branches all forked from a common commit, [master], whose commit message is "Add \*(Aqgit show\-branch\*(Aq"\&. 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"\&.
  188. .SH "EXAMPLES"
  189. .sp
  190. If you keep your primary branches immediately under \fBrefs/heads\fR, and topic branches in subdirectories of it, having the following in the configuration file may help:
  191. .sp
  192. .if n \{\
  193. .RS 4
  194. .\}
  195. .nf
  196. [showbranch]
  197. default = \-\-topo\-order
  198. default = heads/*
  199. .fi
  200. .if n \{\
  201. .RE
  202. .\}
  203. .sp
  204. With this, \fBgit\fR \fBshow\-branch\fR 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\&.
  205. .sp
  206. .if n \{\
  207. .RS 4
  208. .\}
  209. .nf
  210. $ git show\-branch \-\-reflog="10,1 hour ago" \-\-list master
  211. .fi
  212. .if n \{\
  213. .RE
  214. .\}
  215. .sp
  216. shows 10 reflog entries going back from the tip as of 1 hour ago\&. Without \fB\-\-list\fR, the output also shows how these tips are topologically related to each other\&.
  217. .SH "CONFIGURATION"
  218. .sp
  219. Everything below this line in this section is selectively included from the \fBgit-config\fR(1) documentation\&. The content is the same as what\(cqs found there:
  220. .PP
  221. showBranch\&.default
  222. .RS 4
  223. The default set of branches for
  224. \fBgit-show-branch\fR(1)\&. See
  225. \fBgit-show-branch\fR(1)\&.
  226. .RE
  227. .SH "GIT"
  228. .sp
  229. Part of the \fBgit\fR(1) suite