What exactly is a “grafted” commit in a shallow clone?

时间秒杀一切 提交于 2019-12-03 01:09:14

From your link:

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.

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.

In effect:

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!