.git/info/grafts 有什么用? [英] What are .git/info/grafts for?

查看:18
本文介绍了.git/info/grafts 有什么用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想弄清楚 Git 中的移植"是什么.

I am trying to figure out what is the 'grafts' in the Git.

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

For example, in one of the latest comments here, Tobu suppose to use git-filter-branch and .git/info/grafts to join two repositories.

但我不明白为什么我需要这些移植物?看来,没有最后两个命令,一切都可以工作.

But I don't understand why I need these grafts? It seems, that all work without last two commands.

推荐答案

来自 Git Wiki:

移植点或移植物使两个否则不同的行共同发展.它通过让用户记录虚假来工作提交的祖先信息.这你可以让 git 假装设置的方式一个提交的父母是不同的从提交时记录的内容已创建.

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.

使用移植物的原因

移植物在移动时很有用开发到 git,因为它允许你要克隆旧的历史从另一个 SCM 可选导入.这为用户保留了初始克隆谁只想关注最新的降低版本,而开发人员可以拥有完整的发展历程可用.

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.

当 Linus 开始使用 git 时在那里维护他的内核树不存在任何工具来转换旧的内核历史.后来,当旧的内核历史被导入来自 bkcvs 网关的 git,grafts 是创建作为制作它的方法可以将两个不同的存储库在一起.

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/info/grafts 有什么用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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