我試圖找出哪個遠程分支最近更新。像'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 rebase分支後推新提交
- 10. Git + Gerrit跨分支提交?
- 11. 與每個提取後更改遠程分支git問題
- 12. 遠程git提交工具?
- 13. git遠程分支監控
- 14. git推遠程分支
- 15. 比較遠程Git分支
- 16. 檢出遠程git分支?
- 17. Git遠程分支機構
- 18. 如何從遠程git存儲庫一次提交一個提交?
- 19. Git發佈一個分支到次要的遠程回購
- 20. GIT SHA遠程git分支上的一個文件的ID
- 21. 沒有提交的Git結帳分支
- 22. git pull推送提交到遠程分支
- 23. 無法將git遠程分支恢復到早期提交
- 24. 如何git rebase合併提交共享遠程分支?
- 25. 每個分支的Git提交鉤子
- 26. Git:同時提交多個分支
- 27. Git fetch沒有下載遠程分支
- 28. 在git中分裂第一次提交
- 29. 我可以使用tortoise git提交給另一個遠程分支嗎?
- 30. 如何在git中檢查最後一次更改是哪個分支?
我認爲的Jakub的答案是比我好。如果你不需要bash腳本的額外的靈活性,我更喜歡內置的解決方案。 – MForster 2010-11-05 11:40:07