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.
總結
以上是生活随笔為你收集整理的diff git 指定时间,git diff日期?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何提升远程办公的工作效率如何提升远程办
- 下一篇: 在没有光纤宽带的场所在没有光纤宽带的场所