2012-03-13 106 views

回答

25

如果你想提交您需要的--all參數,限制git的日誌,所有分支十與-10和使用 - 日期命令告訴git日誌排序提交關於日期。

git log -10 --all --date-order 
1

試試這個git log --graph &你會得到提交的順序最新舊隨着

•the checksum of the commit 
•the author name and email 
•the date the author committed it 
•the full commit message 

編輯:

,或者您可以使用:

git log --pretty=oneline --graph

它提供了所有提交&分支拓撲

+0

我想獲得最新提交的所有分支 – why 2012-03-13 05:54:53

+0

見我'edited'回答 – uday 2012-03-13 05:56:15

4

要查找的提交具體數量,你可以使用-n選項:

git log -5 # or git log -n 5 # fetches the last 5 commits 

爲,@honk指出,-n 5-5是等價的。

要找到其他分支提交,沒有檢查出其他的分支:

git log branch_name 

所以,如果你是在開發分支,希望得到最後的10個提交碩士(ONELINE),你可以這樣做:

git log --oneline master -10 

要查看所有分支的提交,有一個--all參數。

git log --all 
+1

你可能已經編寫了'-n 5'和'-5'是等價的。並且看到所有分支當然都使用'-all'(談論git CLI有多困難)。 – 2012-03-13 06:38:07

+0

@ honk - 是啊。我認爲你的意思是「 - 全部」。我會更新答案。謝謝。 – prasvin 2012-03-13 08:01:20

4

對於所有分支機構去年10名提交,你可以這樣做:

git log --graph --all --format=format:'%h - (%ai) %s — %cn %d' --abbrev-commit --date=relative -10 
  • %h是提交哈希
  • %AI是作者日期(用%CI爲提交者爲準)
  • %s是提交主題
  • %cn是提交者名稱
  • -10指最後10個提交

在這裏看到更多的信息,如果您需要進一步自定義: http://linux.die.net/man/1/git-log

+0

@爲什麼我認爲這是你正在尋找的..它的作品! – Bijendra 2012-03-13 06:58:16