git branch 命令不仅可以创建与删除分支,还可以查看分支列表

$ git branch
  iss53
* master
  testing

master分支前的*字符,表示当前分支

如果要查看每个分支的最后一次提交,可以运行git branch -v

$ git branch -v
  iss53   93b412c fix javascript issue
* master  7a98805 Merge branch 'iss53'
  testing 782fd34 add scott to the author list in the readmes

--merged--no-merged 用来过滤列表中已经合并或尚未合并到当前分支的分支

$ git branch --merged
  iss53
* master

查看所有包含未合并工作的分支

$ git branch --no-merged
  testing

results matching ""

    No results matching ""