来自另一个存储库目录的Git子模块 [英] Git submodule from just a directory of another repository

查看:48
本文介绍了来自另一个存储库目录的Git子模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以创建一个子模块,该子模块不直接链接到存储库,而是链接到其中的目录?

Is it possible to create a submodule that does not link to a repository directly, but to a directory inside it?

例如,假设fw.git是一个框架存储库,其中包含以下内容:

For example, let fw.git be a framework repository, with these dirs:

|fw.git
\---|test
    |code
    |tools

我想对框架代码进行子模块化,仅对 code 目录,而不对其他目录进行子模块.

I'd like to submodule the framework code, just the code directory, not other directories.

推荐答案

否,这是不可能的.Linus故意使git不能那样工作.

No, it's not possible. Linus intentionally made git not work like that.

这篇关于来自另一个存储库目录的Git子模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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