git: Log for 'master' only goes back to da

2020-07-03 07:37发布

问题:

When I do the following in my working copy:

> git diff 'master@{1 hour ago}'

It prints

warning: Log for 'master' only goes back to Thu, 14 Jan 2016 15:37:11 -0500.

Yet when I do git log master, it clearly goes back farther:

commit bb9c80fb1c3895a9c11f7a60710497cc8406e71f
Author: Andy Edwards <andy@example.com>
Date:   Tue Jan 12 22:44:21 2016 -0600
...

Am I doing something wrong, or is this a git bug?

回答1:

Use git-whatchanged instead.

git whatchanged --since="1 hour ago" --patch