团队之间共享库的单个或多个 Git 存储库
我正在考虑如何/是否应该从 svn 切换到 git。
我目前在 svn 中有一组多层项目,这些项目是分层的,D 使用 C,C 使用 B,B 使用 A。实际部署的项目(如 X、Y、Z)使用任何公共库 AD。目的是让未来的项目和其他团队共享基础库 (AD) 并实现更好的分支控制。
在 svn 中,如果我们希望允许其他团队使用库 C,而不涉及 X、Y、Z,那么很简单,他们只需检查 svn 树的 C 位,如果这导致他们想要修补 B,那么同上。即使它们位于同一个实际仓库中,它们也永远不会接触 X、Y、Z。 git 发生的情况并不是那么明显。
如果我想使用 git 设置一些东西,你会建议我如何设置它以及你建议的设置有哪些优点/缺点。
我正在寻找的功能是:
- 简单的标记(如果可能),以便可以轻松标记整个代码库的状态(使用通用的 svn 根或单个 git 存储库即可轻松实现)
- 其他人可以轻松集成/重用通用库 AD
- 对他们来说很简单给我们返回建议的修复/补丁,我们可以选择接受或忽略(我想从 git 获得的主要内容之一)。
- 团队拥有可用于共享库的有效私有所有权功能(这样他们就可以在自己的时间表上标记它们并自行修复它们)
Git 似乎提供了我想要的东西,我只是不确定如何处理单个与多个存储库问题。
I am looking at how/if I should make the switch from svn to git.
I currently have a multi-layered set of projects in svn which are layered such that D uses C which uses B which uses A. Actual deployed projects like X,Y,Z use any of the common libraries A-D. The aim is for future projects and other teams to share the base libraries (A-D) and to enable better branching control.
In svn if we wish to allow other teams to use library C without getting involved with X,Y,Z then it is simple, they just check out the C bit of the svn tree, if that leads to them wanting to patch B, then ditto. They never touch X,Y,Z even if they are in the same actual repo. It is not so obvious what happens with git.
If I wish to set something up using git, how would you suggest I set it up and what are the upsides/downsides with your suggested setup.
Features I am looking for are:
- Simple tagging (if possible) so can tag the state of the whole codebase easily (simple with a common svn root or a single git repo)
- Easy for others to integrate/reuse the common libraries A-D
- Simple for them to give us back suggested fixes/patches which we can choose to take or ignore (one of the main things I want from git).
- Teams to have effectively private ownership features available for shared libraries (so they can tag them and fix them for themselves on their own timelines)
Git seems to offer what I want, I am just not sure how to deal with the single vs multiple repos problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需使用多个 git 存储库(它们非常便宜,并且类似于许多小船而不是泰坦尼克号 - 换句话说,我发现它们很灵活并且我喜欢灵活性)。
有时我会协助一个结构如下的项目
“服务器”、“客户端”、“文档”和“工具”中的每个文件夹都是单独的 git 存储库。这使得专业团队成员能够克隆并完成他们想要做的事情。
更不用说,如果我们只想拉入所有内容,我们可以克隆 foo (它将其余部分作为子模块拉入)。
git 允许你做到这一点真是太棒了,为什么不利用它呢?
我的建议实施起来可能有点复杂。
Just go with multiple git repositories (they are quite cheap and they are akin to many small boats instead of a Titanic--in other words, I find that they are flexible and I love flexibility).
Now and then I assist with a project that is structured like so
The 'server', 'client', 'docs' and every folder in 'tools' are separate git repositories. This allows specialized team members to clone and work on exactly what they wish to work on.
Not to mention, if we just want to pull in everything, we can clone foo (which pulls in the rest as sub-modules).
It's awesome that git allows you to do this so why not take advantage of it?
It's possible that my suggestion is slightly complex to implement.