2012-03-13 109 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