gpt4 book ai didi

git - Git 中的什么等同于 ClearCase 中的只读组件?

转载 作者:太空狗 更新时间:2023-10-29 13:23:40 25 4
gpt4 key购买 nike

我的公司正在将我们的版本控制工具从 Rational ClearCase 更改为 Git。我们有以下开发场景,我们很好奇 Git 是否可以遵循适当的模式来实现我们在 ClearCase 中的相同行为。

以下是关于我们情况的一些基本 Gist :

  1. We have a number of discrete applications. Let's call these AppA, AppB, and AppC.
  2. We also have certain files (build scripts, etc.) that are common to all of the projects. Let's call this Tools.
  3. For any given cut of the AppA, AppB, or AppC code, we need a specific cut of the Tools code.
  4. Most of our developers never modify the Tools code.

对于 ClearCase,我们将其建模如下:

Components: app_a, app_b, app_c, tools

Projects: AppA, AppB, AppC, Tools

Project AppA includes app_a as a read/write component and tools as a read-only component.

Project AppB includes app_b as a read/write component and tools as a read-only component.

Project AppC includes app_c as a read/write component and tools as a read-only component.

Project Tools includes tools as a read/write component.

Each baseline for the App* projects references a baseline on both the app_* and tools compoments. When developers rebase to the recommended baseline, they pull in changes from both components.

对于 Git,我们认为子模块可能是最接近正确答案的东西。但是,在 pull/ rebase 存储库时,听起来需要额外的步骤来更新子模块代码。理想情况下,我们希望保持透明。此外,我们不一定关心从父存储库的角度了解子模块中发生了什么变化;我们只关心整个子模块的一个时间点。

最佳答案

首先,请务必了解 ClearCase 和 git 中的(类 UCM)配置之间的区别(参见“Flexible vs static branching (GIT vs Clearcase/Accurev)”)。
查看 differences between ClearCase and Git 时,每个 UCM 组件都必须在 Git 中表示为存储库。

如“true nature of submodules ”中所述,子模块在修改时需要额外的步骤。
但是他们记录了一个特定的 SHA1,这就是你在 pull 每个“APP”时想要的。
gitslave将允许您将 Tools 与“Appx”更紧密地联系起来,但我认为它不适合您的情况。

请注意,使用子模块将:

  • 将“Tools”设为“APPx”的子目录
  • 使其可修改。
    git 没有“只读”组件:如果您可以访问存储库,则可以推送/pull 。
    如果你真的需要强制读取访问权限,那么你需要添加一个额外的“授权层”,称为 gitolite .

关于git - Git 中的什么等同于 ClearCase 中的只读组件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11164299/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com