我尝试过gitbranch-r,但它只列出了我在本地跟踪的远程分支。我如何找到我没有的列表?(该命令是否列出所有远程分支或仅列出未跟踪的分支对我来说无关紧要。)


当前回答

我会使用:

git branch -av

该命令不仅显示所有分支的列表,包括以/remote开头的远程分支,而且还提供有关更新内容和上次提交注释的*反馈。

其他回答

接受的答案对我有用。但我发现从最近的提交开始排序更有用。

gitbranch-r--sort=提交日期

https://git-scm.com/docs/git-branch

git branch -a | grep remotes/*

Git分支-远程分支

git ls-remote

Git文档。

使用该命令,

git log -r --oneline --no-merges --simplify-by-decoration --pretty=format:"%n %Cred CommitID %Creset: %h %n %Cred Remote Branch %Creset :%d %n %Cred Commit Message %Creset: %s %n"

CommitID       : 27385d919
Remote Branch  : (origin/ALPHA)
Commit Message :  New branch created

它列出了所有远程分支,包括远程分支引用的提交消息和提交ID。

我找到的最简单的方法是:

git branch -a