git: Linux-接下来,如何重置linux-特定日期的旁边?

git: Linux-Next, how to reset linux-next to a particular date?

我知道如果我们知道提交 ID,那么我们可以对该提交使用 reset --hard:

git reset --hard [[commit_id]]

Question 1:如果我想找到指定日期的提交,怎么办?

看起来 Linux-next 每个日期都有一个标签,例如:

https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tag/?id=next-20151001

这是 10 月 1 日的标签,所以我可以很容易地找到当天的提交是 991f9697366015fef03eeeddb4d1ba0f44ff3dc7。

但是,如果我想访问 8 月 1 日的提交,通过这个 link:https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tag/?id=next-20150801

它会告诉我错误的标签。为什么?

Question 2: 我怎么能找到 3 个月前的提交?

比如我知道6月4号的commit,commit id是:94feb25d6fcd34b0d45c18cf0185d83d0c13c60a

但是在我克隆的Linux-next中,如果我运行下面的命令,它会抱怨无效提交;如果我 运行

git show 94feb25d6fcd34b0d45c18cf0185d83d0c13c60a

,会投诉坏对象

如何将 Linux-next 重置为 3 个月前?

user@test_machine MINGW64 /d/Test/linux-next ((e1883c6...)|BISECTING) $ git show 94feb25d6fcd34b0d45c18cf0185d83d0c13c60a fatal: bad object 94feb25d6fcd34b0d45c18cf0185d83d0c13c60a

您想使用 --since--after,如 man git-log 中指定的那样。

你不能,linux-next git 树每天都会重新设置基础,以前的标签和对象将从存储库中消失。

但是,linux-next-history 应该包含所有必要的对象: http://git.kernel.org/cgit/linux/kernel/git/next/linux-next-history.git/