如何在一个bndtools工作区中使用多个git存储库(How to use multiple git repositories in one bndtools workspace)

编程入门 行业动态 更新时间:2024-10-23 16:25:35
如何在一个bndtools工作区中使用多个git存储库(How to use multiple git repositories in one bndtools workspace)

我正在使用带有一些专用工作区的eclipse BndTools,每个工作区都存储在一个git repo中,我一直很开心。

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

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

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

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

I am using eclipse BndTools with a few dedicated workspaces each stored in a single git repo and I've been quite happy sofar.

I've been sharing projects between workspaces by copying them. But recently decided to pull common code into a shared code git repository. In eclipse this is trivial, just use subfolders in your workspace, one per repository.

However to my surprise bndtools demands that I place one cnf project next to my projects in the filebase. At the same time I can only have one cnf project in my workspace. 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 and with 50+ projects this is clearly not where I want to go.

I know eclipse can do this, but is there a way to get bndtools to play ball?

最满意答案

这实际上意味着我的所有项目应该是同行。 ...

这反过来意味着我不能使用多个git存储库,因为它们不能共享同一个目录。 除非我将每个项目拆分为自己的存储库

这是子模块即将进行救援的地方。

Submodules 允许外部存储库嵌入源树的专用子目录中,始终指向特定的提交。

在此处输入图像描述


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

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

This is where submodule is coming for rescue.

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

enter image description here


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

更多推荐

本文发布于:2023-07-16 07:32:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1125456.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   区中   如何在   工作   bndtools

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!