gpt4 book ai didi

git - .git/info/grafts 有什么用?

转载 作者:IT王子 更新时间:2023-10-29 00:46:16 25 4
gpt4 key购买 nike

我想弄清楚 Git 中的“嫁接”是什么。

例如,在最新评论之一here , Tobu 假设使用 git-filter-branch.git/info/grafts 加入两个存储库。

但我不明白为什么我需要这些嫁接?看起来,没有最后两个命令,所有的工作。

最佳答案

来自 Git Wiki :

Graft points or grafts enable two otherwise different lines of development to be joined together. 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.

Reasons for Using Grafts

Grafts can be useful when moving development to git, since it allows you to make cloning of the old history imported from another SCM optional. This keeps the initial clone for users who just wants to follow the latest version down while developers can have the full development history available.

When Linus started using git for maintaining his kernel tree there didn't exist any tools to convert the old kernel history. Later, when the old kernel history was imported into git from the bkcvs gateway, grafts was created as a method for making it possible to tie the two different repositories together.

关于git - .git/info/grafts 有什么用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/161928/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com