如何在一个 bndtools 工作空间中使用多个 git 存储库

How to use multiple git repositories in one bndtools workspace

我正在使用带有几个专用工作区的 eclipse BndTools,每个工作区都存储在一个 git 存储库中,到目前为止我一直很开心。

我一直在通过复制项目在工作区之间共享项目。但最近决定将公共代码拉入共享代码 git 存储库。在 Eclipse 中这是微不足道的,只需在您的工作区中使用子文件夹,每个存储库一个。

然而令我惊讶的是,bndtools 要求我在文件库中的项目旁边放置一个 cnf 项目。同时我的工作区只能有一个cnf项目。这实际上意味着我的所有项目都应该是同行。

这反过来意味着我不能使用多个 git 存储库,因为它们不能共享同一个目录。除非我将每个项目拆分到它自己的存储库中,并且有 50 多个项目,否则这显然不是我想去的地方。

我知道eclipse可以做到这一点,但是有没有办法让bndtools玩球?

Which effectively means ALL my projects should be peers.
...

Which in turn means I cannot use multiple git repositories as they cannot share the same directory. Unless I split each project into it's own repository

这是子模块来救援的地方。

Submodules allow foreign repositories to be embedded within a dedicated subdirectory of the source tree, always pointed at a particular commit.


How to use submodules

# Create each project in its own repository

# now add the desired submodule to your project
git submodule add <url>

# now init/update one by one or recursively all at once
git submodule init
git submodule update