简体   繁体   English

我可以在自己的存储库中有一个克隆的git存储库吗?

[英]Can I have a cloned git repo inside my own repo?

Say I've got a project under git version control. 说我有一个在git版本控制下的项目。 Within that project, I have a folder called "third_party_tools." 在该项目中,我有一个名为“ third_party_tools”的文件夹。 And within that folder, I've got a folder called "some_open_source_tool," which was cloned from github. 在该文件夹中,我有一个名为“ some_open_source_tool”的文件夹,该文件夹是从github复制的。

Will this cause problems? 这会引起问题吗? Can I check the tool into git for my project and retain the ability to pull from github if there are updates? 我可以为我的项目将工具检入git并保留是否有从github提取更新的功能吗? Or is it not permitted to have one git repo inside another? 还是不允许在另一个内部有一个git repo?

It is permitted to have one git repository inside another. 允许在另一个内部有一个git存储库。 If you want to check the tool into your outer project, I would recommend you look into submodules , which allow you to keep nested git projects in sync properly. 如果要将工具检入外部项目中,建议您查看子模块 ,该子模块可让您正确嵌套嵌套git项目。

如果使用--recursive标志进行克隆,Nathan将获得所需的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM