git:哪个远程git分支有最后一次提交?

时间:2010-11-04 20:28:59

标签: git

我试图弄清楚最近更新了哪个远程分支。像'git show-ref'这样的东西,但按时间顺序就足够了。我该怎么做呢?

3 个答案:

答案 0 :(得分:2)

一个小小的bash脚本怎么样?

>> git show-ref | while read sha1 ref; do echo $(git log --pretty=format:%ai -1 $sha1) $ref ; done | sort
2010-10-23 15:30:57 +0200 refs/remotes/mambo/mambo
2010-10-23 15:30:57 +0200 refs/remotes/mambo/master
2010-10-29 22:38:23 +0200 refs/heads/master
2010-10-29 22:38:23 +0200 refs/remotes/nas/HEAD
2010-10-29 22:38:23 +0200 refs/remotes/nas/master

答案 1 :(得分:2)

使用git for-each-ref,例如:

$ git for-each-ref --format='%(committerdate)%09%(refname)' \
  --sort=-committerdate refs/remotes/
2010-10-21 21:50:30 +0200       refs/remotes/git/trast/t/doc-config-extraction-v2
2010-09-23 17:40:05 -0700       refs/remotes/gitweb-kernel.org/master
2010-07-16 11:49:38 +0530       refs/remotes/gsoc2010/gitweb-write/master
2010-06-13 21:02:44 -0700       refs/remotes/gsoc2010/gitweb-write/next
2010-06-08 05:54:00 +0000       refs/remotes/gsoc2010/gitweb-write/man
2010-06-08 05:53:58 +0000       refs/remotes/gsoc2010/gitweb-write/html
2010-06-07 22:16:45 -0700       refs/remotes/gsoc2010/gitweb-write/pu
2010-06-07 15:50:21 -0700       refs/remotes/gsoc2010/gitweb-write/maint
2010-06-02 16:16:06 -0700       refs/remotes/gsoc2010/gitweb-write/todo
2010-01-13 17:06:29 -0800       refs/remotes/gitweb-kernel.org/gitweb-ml-v5

答案 2 :(得分:0)

如果您有GUI,则可以使用gitk来观察GUI中的所有分支