为什么git认为HEAD是17年前的第一次提交? [英] Why does git think HEAD is the first commit from 17 years ago?

查看:96
本文介绍了为什么git认为HEAD是17年前的第一次提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试收集 [现在,然后] 范围内的提交列表,其中 NOW HEAD [THEN] 8af39377 ,并且它大约在120次提交之前。

I'm trying to gather up the list of commits in the range [NOW, THEN], where NOW is HEAD and [THEN] is 8af39377, and its about 120 commits ago.

运行时

>  git log 8af39377289feba1876b3252b6d23 HEAD --oneline | cut -d " " -f 1 > commits.txt

,然后查看 commits.txt ,它的2300行长,显示的顶部条目为 8af39377 THEN ),底部条目为 a3b6ece (2002年的第一次提交)。

and then look at commits.txt, its 2300 lines long and it shows the top entry as 8af39377 (the THEN) and the bottom entry as a3b6ece (the first commit from 2002).

为什么Git认为 HEAD 是对存储库的第一次提交?

Why does Git think HEAD is the first commit to the repository?

推荐答案

您的语法错误。如果您想要8af39和HEAD之间的范围,则需要 8af39..HEAD

Your syntax is wrong. If you want the range between 8af39 and HEAD then you need 8af39..HEAD

至于为什么它显示17多年前,如果仅指定一个修订,它将找到该提交所能到达的所有提交。由于所有提交都一直指向根目录,因此您会找到根提交。

As for WHY it's showing 17 years ago, if you just specify a single revision, it will find all the commits REACHABLE by that commit. Since all commits have backwards pointers all the way to the root, you're finding the root commit.

修订说明请参见有关指定范围的部分。

Revision Specification See the section on specifying a range.

这篇关于为什么git认为HEAD是17年前的第一次提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆