将 git 项目拆分为多个子项目的另一个用例
我已将我的项目分成几个子项目 但它们都有一个共同的部分(带有 cmake 脚本的目录)。 此外,某些子项目需要包含其他子项目(库)。
我更喜欢使用 git 子模块,但据我所知它们有一个限制 子模块需要位于存储库中的单独目录中(是吗?)这有点束缚我的手,因为我不想在超级项目或任何子项目中复制任何源或 cmake 脚本。
您建议如何解决?
I have split my project into several subprojects
But all have a common part (directory with cmake scripts).
Moreover some subproject need to include other subprojects (libraries).
I would prefer to use git submodules but as far as I know they have a limitation
that a submodule needs to be in a separate directory in the repo (does it?) what ties my hands a little as I don't want to duplicate any source or cmake scripts in a superproject or any of subprojects.
How do you propose to solve it ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有看到问题所在。 您的库根本不应该是子模块,而应该是完全独立的项目。 如果您确实想让它们成为子模块,它们肯定会希望位于自己的目录中。 至于cmake脚本,你说它们已经在自己的目录中,所以将该目录作为子模块不是问题。 也许你需要澄清这个问题。
I don't see the problem. Your libraries should not be submodules at all, but totally separate projects. If you do want to make them submodules, they will certainly want to be in their own directories. As for the cmake scripts, you say that they are already in their own directory, so making that directory a submodule is not a problem. Perhaps you need to clarify the problem.