我正在使用带有一些专用工作区的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 updateWhich 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.
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更多推荐
发布评论