git查看两次提交之间的差异_如何获取使用Git在两个日期之间发生的所有提交之间的差异?...

我相信一般的解决方案是使用:

git rev-list -n1 --first-parent --until=

如果没有--first-parent,您可能会从一个分支中获得一个提交,该分支后来被合并到,a ref但截至时尚未被合并a date string。

这是使用--children和grep代替的替代方法-n1:

mlm_git_ref_as_of() {

# # Examples #

#

# Show all commits between two dates:

#

# git log $(mlm_git_ref_as_of '2012-05-21 09:00:00-0400')..$(mlm_git_ref_as_of '2012-05-21 17:00:00-0400')

#

# Show diffs of all commits between two dates:

#

# git diff $(mlm_git_ref_as_of '2012-05-21 09:00:00-0400')..$(mlm_git_ref_as_of '2012-05-21 17:00:00-0400')

local as_of="$1"

local ref="${2:-HEAD}"

# Get the most recent commit (--children, grep -v ' ') that was on

# the given branch ($ref, --first-parent) as of a given date

# ($as_of)

git rev-list --children --first-parent --until="$as_of" "$ref" | grep -v ' '

}

git whatchanged在阅读此问答之前,我并不熟悉,但是它给我带来了截然不同的结果,因此我不确定它在做什么。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值