我试图找出哪个远程分支最近更新。像'git show-ref',但按照时间顺序就足够了。我如何去做这件事?git:哪个远程git分支有最后一次提交?
2
A
回答
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
0
,如果你还拥有图形用户界面,您可以使用gitk
为观察各分公司在GUI
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
相关问题
- 1. Git远程分支提交
- 2. 删除git远程分支提交
- 3. 恢复到最后一次提交的git的分支
- 4. Git的最后两次提交隔离在两个分支
- 5. Git在第一次提交时删除分支时在远程分支上提交提交
- 6. 远程Git分支
- 7. 搜索提交文件内容的Git远程分支提交?
- 8. Git - 最后一次提交,直到分支机构的某个日期
- 9. git分支前几次提交?
- 10. git只推送一个分支提交
- 11. Git远程起源有两个分支
- 12. git rebase分支后推新提交
- 13. git分支撤消提交
- 14. Git - 提交出主分支
- 15. 的Git分支VS提交
- 16. Git + Gerrit跨分支提交?
- 17. Git合并分支提交
- 18. 与每个提取后更改远程分支git问题
- 19. 远程git提交工具?
- 20. Git远程分支机构
- 21. 比较远程Git分支
- 22. 重置远程git分支
- 23. git远程分支监控
- 24. 检出远程git分支?
- 25. git推远程分支
- 26. 具体分支远程Git
- 27. 如何从远程git存储库一次提交一个提交?
- 28. Git发布一个分支到次要的远程回购
- 29. GIT SHA远程git分支上的一个文件的ID
- 30. 恢复(没有分支)git提交
我认为的Jakub的答案是比我好。如果你不需要bash脚本的额外的灵活性,我更喜欢内置的解决方案。 – MForster 2010-11-05 11:40:07