同步 GIT 和 ClearCase
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2477321/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Sync GIT and ClearCase
提问by Senthil A Kumar
I am currently working on ClearCase and now migrating to GIT. But we need this migration in a way that all work will be done in GIT and the data will be synced backed to ClearCase stream. We will have the same branch names and stream names in both GIT and CC, so scripting shouldn't be a problem. The problem here is,
我目前正在研究 ClearCase,现在正在迁移到 GIT。但是我们需要这种迁移方式,所有工作都将在 GIT 中完成,并且数据将同步回 ClearCase 流。我们将在 GIT 和 CC 中使用相同的分支名称和流名称,因此脚本编写应该不成问题。这里的问题是,
Can someone suggest which is the best model to sync CC and GIT
有人可以建议哪个是同步 CC 和 GIT 的最佳模型吗
Have all the Vobs in CC as single repo in GIT, and have the major stream in CC as various branches in GIT. - Single GIT repo (VOBS) and many branches (CC streams). - This takes up less space as VOBs are kept as single repo with many branches.
Have important CC branches as independent GIT repositories and each repository having all the CC VOBs. - Many GIT repo for many CC branch - This will take up lots of space as VOBs will be replicated across.
将 CC 中的所有 Vobs 作为 GIT 中的单个 repo,并将 CC 中的主流作为 GIT 中的各个分支。- 单个 GIT 存储库 (VOBS) 和多个分支(CC 流)。- 这占用的空间更少,因为 VOB 被保存为具有许多分支的单个存储库。
将重要的 CC 分支作为独立的 GIT 存储库,并且每个存储库都具有所有 CC VOB。- 许多 CC 分支的许多 GIT 存储库 - 这将占用大量空间,因为 VOB 将被复制。
Which do you think is the best way to keep it in sync with ClearCase
您认为与 ClearCase 保持同步的最佳方式是什么
采纳答案by VonC
Have all the Vobs in CC as single repo in GIT, and have the major stream in CC as various branches in GIT
将 CC 中的所有 Vobs 作为 GIT 中的单个 repo,并将 CC 中的主流作为 GIT 中的各个分支
No and yes
不,是
Have important CC branches as independent GIT repositories and each repository having all the CC VOBs
拥有重要的 CC 分支作为独立的 GIT 存储库,并且每个存储库都拥有所有 CC VOB
No and No
没有和没有
Re-reading my answer about Git limits, you shouldn't try to cram "everything" in a Git repo.
See also "What are the basic clearcase concepts every developer should know?" for a comparison between ClearCase and Git.
重新阅读我关于Git 限制的回答,你不应该试图在 Git 存储库中塞满“一切”。
另请参阅“每个开发人员应该知道的基本 clearcase 概念是什么?”以了解ClearCase 和 Git 之间的比较。
Stream can safely be imported as branch.
But VOBs are not necessarily a Git Repo.
Stream 可以安全地作为分支导入。
但是 VOB 不一定是 Git 存储库。
If you are using UCM, I would recommend one Git repo per UCM component.
如果您使用 UCM,我建议每个 UCM 组件使用一个 Git 存储库。
Anyway, you need to record in your Git Repo a way to know what ClearCase view to use to sync back (through a simple clearfsimport
) your data.
The view used for that ClearCase data re-import will be a UCM view automatically associated to the right stream, for the right VOB.
无论如何,您需要在您的 Git Repo 中记录一种方式,以了解要使用哪个 ClearCase 视图同步回(通过简单的clearfsimport
)您的数据。
用于该 ClearCase 数据重新导入的视图将是一个自动关联到正确流的 UCM 视图,用于正确的 VOB。
Note: I mention in "How to bridge git to ClearCase?" a simpler solution, but which does not import the allhistory in a Git repo.
注意:我在“如何将 git 桥接到 ClearCase?”中提到了一个更简单的解决方案,但它不会在 Git 存储库中导入所有历史记录。
回答by charleso
回答by Marko
Regarding branches and repos, I would go with one vob == one git repo rule, since git repo is really meant to be used by single project, the same way as for vobs.
关于分支和存储库,我会使用一个 vob == 一个 git repo 规则,因为 git repo 实际上是由单个项目使用的,与 vobs 的方式相同。
As for branches, branch names across vobs/repos should match. Take a look at submodules in git to see if this can be used in your case.
至于分支,跨 vobs/repos 的分支名称应该匹配。查看 git 中的子模块,看看这是否可以用于您的情况。
What I personaly would like to see is a mature git-cc backend, which will allow me to use git on my dev-box, while being able to sync with corporate CC repository I am forced to use.
我个人希望看到一个成熟的 git-cc 后端,它允许我在我的开发箱上使用 git,同时能够与我被迫使用的企业 CC 存储库同步。