← 返回命令列表

Linux command

git-show-branch 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Show branch relationships

git show-branch

Show specific branches

git show-branch [branch1] [branch2]

Show all branches

git show-branch --all

Show with more context

git show-branch --more=[10]

Show with color

git show-branch --color

说明

git show-branch displays branches and their commits with visual indicators showing which commits belong to which branches. It provides a compact overview of branch divergence and shared history. This is useful for understanding how branches relate to each other, especially when multiple branches share common ancestors.

参数

-a, --all
Show all refs.
-r, --remotes
Show remote branches.
--more _n_
Show more commits.
--list
List mode.
--topo-order
Topological order.
--date-order
Date order.
--color
Color output.

FAQ

What is the git-show-branch command used for?

git show-branch displays branches and their commits with visual indicators showing which commits belong to which branches. It provides a compact overview of branch divergence and shared history. This is useful for understanding how branches relate to each other, especially when multiple branches share common ancestors.

How do I run a basic git-show-branch example?

Run `git show-branch` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a, --all do in git-show-branch?

Show all refs.