diff git 指定时间_git diff日期?

I'm accustomed to running a git comparison that will allow comparison with local git revs like:

git diff HEAD HEAD~110 -- some/file/path/file.ext

Is it possible to use the date instead? And if so, how? I would like to be able insert in place of the "110" in the above example, a date such as "4 Dec 2012".

解决方案git diff HEAD 'HEAD@{3 weeks ago}' -- some/file/path/file.ext

This is not, strictly speaking, the revision made three weeks ago. Instead, it's the position HEAD was at three weeks prior to the present. But it's probably close enough for your purposes - it will be very accurate if the current branch's HEAD moved forward steadily, as most tend to do. You can improve the accuracy by using a branch name instead of HEAD.

Instead of an offset-from-the-present, you can also use a date/time, like HEAD@{1979-02-26 18:30:00}. See git help rev-parse.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值