有没有可能获取到一个git仓库的所有分支以及它们的最新提交。
如果我有以下的仓库:
* b562239 (HEAD -> master) lastCommit
* 3828834 (seccondBranch) seccond Commit
| * 3f6fdf6 (firstBranch) branchCommit
|/
* b051ccd init repo
我想要获得这样的列表:
master b562239
seccondBranch 3828834
firstBranch 3f6fdf6
for-each-ref
。 - NelDavgit branch
使用较少。 - Romain Valerirefs/heads
替换为refs/remotes
。 - Piotr Siupa