Git中子项目和子模块之间的区别? [英] Difference between subprojects and submodules in Git?

查看:203
本文介绍了Git中子项目和子模块之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Git中,子模块(由git子模块命令创建和管理)和子项目(字面上只是一个放在另一个Git存储库中的Git存储库)之间有区别,如果是这样,它是什么?



我所能找到的关于这个的所有文档都很模糊(在某些情况下是相互矛盾的)。我怀疑是没有区别,但我想我应该确认,并留下一个问题让Git新手找到。

解决方案

p> 子项目是三种嵌套类型之一的通用术语:
$ b


  • 子模块将超级项目的半固定引用提供给子项目并集成到git中。当子项目:


    • 由其他人开发时,它最好用于超级项目的管理控制下,并且遵循不同的发布周期。

    • 包含超级项目之间共享的代码(特别是当意图是将错误修正和新功能传播回其他超级项目时)。
    • 分隔巨大和/或多个文件这会损害日常git命令的性能。 子树会导致子项目存储库被导入到超级项目的存储库中以成为存储库的本地部分具有完整的历史记录,通常位于超级项目的特定子目录中。

    • 包装,它为具有关联子项目的超级项目提供多存储库管理功能。


    参考文档


    In Git, is there a difference between a "submodule" (as created and managed by the git submodule command) and a "subproject" (literally just one Git repository that you put inside another Git repository), and if so, what is it?

    All the documentation I've been able to find about this is rather ambiguous (and in some cases, contradictory). My suspicion is that there is no difference, but I figure I ought to confirm that and leave a question for Git newbies to find.

    解决方案

    A subproject is a generic term for one of three types of nesting:

    • Submodules provide semi-fixed references from the superproject into subprojects and are integrated into git. It is best used when the subproject:
      • is developed by someone else, is not under the administrative control of the superproject and follows a different release cycle.
      • contains code shared between superprojects (especially when the intention is to propagate bugfixes and new features back to other superprojects).
      • separates huge and/or many files that would hurt performance of everyday git commands.
    • Subtrees causes the subproject repository to be imported into the superproject's repository to be a native part of the repository with full history, typically in a specific subdirectory of the superproject.
    • Wrappers, which provide multi-repository management functionality to a superproject with associated subprojects.

    Reference documentation

    这篇关于Git中子项目和子模块之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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