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

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

问题描述

我试图弄清楚Git中的'嫁接'是什么。

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

但是我不明白为什么我需要这些嫁接 ?看来,所有这些工作都没有最后两条命令。 解决方案

Git Wiki


移植点或移植物启用两个
不同的
开发线将被连接在一起。它的
通过让用户记录虚假的
血统信息进行提交。这个
的方式可以让git假装提交
时记录的父母的集合
不同于



使用嫁接的原因

当将
开发移动到git时,嫁接可能很有用,因为它允许
您可以克隆从另一个SCM可选项导入的旧历史

这为用户
保留了初始克隆,他们只想跟随最新的
版本,而开发者可以有
的完整开发历史
可用。



当Linus开始将git用于
时维护其内核树时,
不存在任何工具来转换
旧的内核历史记录。后来,当
旧的内核历史从bkcvs网关导入
git时,移植是
创建的,它使
成为可能将两个不同的
存储在一起。



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

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.

解决方案

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

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