所谓的“嫁接"到底是什么?提交一个浅表克隆? [英] What exactly is a "grafted" commit in a shallow clone?

查看:94
本文介绍了所谓的“嫁接"到底是什么?提交一个浅表克隆?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在git中进行浅表克隆(使用--depth选项)时,根提交标记为 grafted .

When doing a shallow clone in git (using the --depth option), the root commit is marked as grafted.

Google搜索并没有得出令人满意的文档.

Googling didn't lead to any satisfacting documentation.

它似乎与 git移植没有任何关系,类似术语的含义.
仅仅是一个标志,表明该提交实际上有更多的父母,不是真正的"根提交吗?还是还有其他特别之处?

It doesn't seem to have anything to do with git grafts, which the similar terminology would imply.
Is it just a flag to signal that this commit actually has more parents and isn't the "real" root commit? Or is there something more special about it?

推荐答案

通过您的链接:

通过让用户记录有关提交的虚假祖先信息来工作.这样,您可以使git假装提交所包含的父母与创建提交时所记录的父母不同.

It works by letting users record fake ancestry information for commits. This way you can make git pretend the set of parents a commit has is different from what was recorded when the commit was created.

在浅表克隆中,您的 root 提交是应该有父母的提交,但不在您的回购协议中.因此,这似乎是嫁接的好用例.

In a shallow clone, your root commit is one that should have parents, but not in your repo. So it seems a good use case for grafting.

有效 :

Def .:浅提交确实有父母,但不在浅组中 回购,并因此引入了嫁接,假装 这些提交没有父母.

Def.: Shallow commits do have parents, but not in the shallow repo, and therefore grafts are introduced pretending that these commits have no parents.

这篇关于所谓的“嫁接"到底是什么?提交一个浅表克隆?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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