如何从git的两个日期之间获取指定用户的差异? [英] How to get diff for specified user between two dates from git?

查看:114
本文介绍了如何从git的两个日期之间获取指定用户的差异?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

或者,如何使用git whatchanged命令列出指定用户的提交?
有没有任何脚本方式? (内置git命令)

解决方案

我相信没有这样的方法可以获得差异只有知道日期。 b
$ b

截至今天,您可以执行以下操作:

  git log  -  sinceOCT 4 2011 2011 - 102011年11月--pretty =格式:%H

然后在第一个和最后一个版本之间的 git diff 如果修订列表太长,请使用上述 git log ... |头-1 |尾部-1 以获取第一个和最后一个版本。



请注意,上述git日志将返回修订版完全在给定日期之间,即修订OCT 5,OCT 6,...,OCT 10。


Or, how to use git whatchanged command to list commits for specified user? Is there any none-scripting way? (builtin git command)

解决方案

I believe there's no such a way to get a diff only knowing dates.

As of today you can do the following:

git log --since "OCT 4 2011" --until "OCT 11 2011" --pretty=format:"%H"

And then git diff between first and last revisions. If the revision list is far too long, use the above git log ... with | head -1 and | tail -1 to get the first and the last revisions.

Note that the above git log will return revisions exactly between given dates, i.e. revisions for OCT 5, OCT 6, ..., OCT 10.

这篇关于如何从git的两个日期之间获取指定用户的差异?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆