Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 1.02 KB

view-all-branches.md

File metadata and controls

43 lines (30 loc) · 1.02 KB
标题 标签
viewAllBranches(查看所有分支) branch,repository(分支,仓库)

要查看 Git 存储库中所有分支的列表,你可以使用 git branch 命令。你可能希望这样做来查看正在进行的工作、可以切换到哪些分支,或者概览存储库的结构。

查看所有本地分支

你可以使用 git branch 显示所有本地分支的列表。与往常一样,你可以使用箭头键浏览列表,然后按 Q 退出。

代码如下:

# 语法: git branch

使用示例:

git branch
# master
# branch-1
# branch-2

查看所有远程分支

类似地,你可以使用 git branch -r 显示所有远程分支的列表。你可以使用与之前相同的导航键和退出键。

代码如下:

# 语法: git branch -r

使用示例:

git branch -r
# origin/master
# origin/branch-1
# origin/branch-2