[英]Git submodule or sub-repository or remote?
I'm using GIT to manage a Content Management System (CMS) project. 我正在使用GIT来管理内容管理系统(CMS)项目。 The CMS can have multiple plugin (module).
CMS可以有多个插件(模块)。
So basically, I want to have 3 types of repositories: 基本上,我想拥有3种类型的存储库:
For the type 1 & 2, I guess it's simple basic repository. 对于类型1和类型2,我猜它是简单的基本存储库。 But when it come to client project, I get confused:
但当涉及到客户项目时,我感到困惑:
So the question is: How should I organize the repository(s) / files / folders in order to be efficient ? 所以问题是:我应该如何组织存储库/文件/文件夹以提高效率?
The layout you've described will work really well with git submodules. 你所描述的布局对git子模块非常有效。 I'd gently recommend reading the docs and trying a few tutorials .
我会温和地推荐阅读文档并尝试一些教程 。 The key difference your plan introduces is that each client repository and client plugin repository will have two remotes instead of one.
您的计划引入的主要区别是每个客户端存储库和客户端插件存储库将具有两个远程控制器而不是一个。 And, when you want to start a new client project you will need to
而且,当您想要启动一个新的客户项目时,您将需要
A better option may be to use the same repository and simply make a branch per client. 更好的选择可能是使用相同的存储库,只需为每个客户端创建一个分支。 That is how I would do it.
这就是我要做的。
Short update / additional information about the previous answer: if you don't like git submodules
approach or think this is too hard to understand, you can try 关于上一个答案的简短更新/附加信息:如果您不喜欢
git submodules
方法或认为这太难理解,您可以尝试
git subtrees
(check this article on medium ) git subtrees
( 在媒体上查看这篇文章 ) git subrepo
(easier alternative to submodules, on Github ) git subrepo
(更容易替代子模块,在Github上 ) Don't forget to check if you can use another depency manager (like RubyGems for Ruby, Composer for PHP...) instead of submodules, it would be easier to use and maintain. 不要忘记检查是否可以使用另一个依赖管理器(如Ruby的RubyGems,PHP的Composer ...)而不是子模块,它将更容易使用和维护。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.