ClearCase与Git版本控制 [英] ClearCase vs. Git version control

查看:156
本文介绍了ClearCase与Git版本控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用多站点 ClearCase 存储库,通常我们需要合并和构建系统。合并和复制需要将近三天的时间才能跨站点使用。因此,为了提高效率,我们计划迁移到 Git 版本控制。您能否告知我们从ClearCase迁移到Git时可能遇到的潜在弊端?

We are using a multisite ClearCase repository, and often we require to merge and build our system. This merge and replication takes almost three days to be available across sites. Hence to be more efficient, we are planning to move to Git version control. Could you please advise of the potential drawback that we can encounter if we move to the Git from ClearCase?

推荐答案

@ zzz777:您的在以ClearCase为中心的观点中提出了一个问题,使得以前从未使用过ClearCase的人无法理解。实际上,Git是ClearCase的光明时代,而且是商业SCM,需要赶上OSS系统。

@zzz777: Your question was asked in such a ClearCase centric view that it failed to be comprehensible to people who never used ClearCase before. In fact, Git is light years ahead of ClearCase, and it is the commercial SCMs that need to catch up with OSS systems.

我对ClearCase和Git都有丰富的经验,我可以告诉您,ClearCase的查找合并(错误)功能是基于版本控制文件的(根本中断)设计的结果,但是在Git中,您不需要这种原始工具即可将共享分支合并到您的私有分支。 ClearCase是面向文件的,而checkin-s是基于文件的,这就是为什么您需要使用Find(文件)合并实用程序的原因,而Git是基于提交的,那是正确的模型,因为当您解决问题或实施解决方案时

I have experience with both ClearCase and Git, and I can tell you that the Find merges (mis)feature of ClearCase is a result of its (fundamentally broken) design based on versioning files, but in Git you don't need such a primitive tool to merge the shared branch to your private branch. ClearCase is file-oriented, and checkin-s are file based, and that's why you need the Find (files) to merge utility, but Git is commit based, and that is the right model, since when you fix an issue or implement a feature, the entire changeset or none of it are the only options that make sense.

Git具有非常强大的合并功能,它做对了事情。有两种方法可以执行您要的操作(将您的私有分支更新为共享分支+您的更改)。

Git has a very powerful merge feature, and it does the right thing. There are two ways to do what you are asking (updating your private branch to be the shared branch + your changes).

最明显的是进行合并,因此而在您的私人分支机构上,您只需执行以下操作:

The most obvious is to do a merge, so while on your private branch you just do:

git merge sharedbranch

然后,如果存在冲突(确实比ClearCase少得多),您可以解决这些冲突并

then, if there are conflicts (really a lot more rare than in ClearCase), you resolve them and

git commit

就是这样。另外,由于Git在本地拥有所有历史记录,因此您不必浪费无数小时,如果您有很多文件(如在ClearCase中一样),那么在动态视图中执行ClearCase时,合并将非常快合并10个文件,Git可能很容易完成100个合并。

And that's it. As a bonus, because Git has all history locally, you don't have to waste countless hours, if you have lots of files, like you do in ClearCase, the merge is blazingly fast, by the time ClearCase in a dynamic view does a merge of 10 files, Git will probably finish merging 100, easily.

使用 git merge 意味着您可以保存历史记录,并且如果您的历史记录看起来像合并前的内容:

Using git merge means that you preserve history and if your history looked like this before the merge:

o---1---2---3 (sharedbranch)
 \
  a---b---c (privatebranch)

会看起来像这样:

o---1---2---3 (sharedbranch)
 \           \
  a---b---c---m (privatebranch)

这将保留您的更改历史记录,并可以允许其他人查看您的工作。

This preserves the history of your changes and can allow others to review your work.

请记住,这些不是文件修订历史。如果树历史记录是唯一有意义的历史记录,即使分支仅相差一个或两个文件也是如此。您要保留的状态是树,而不是一个文件。

And remember, these are NOT file revision histories. These if the tree history, which is the only history that makes sense to store, even if branches differ only by one or two files. The state you want to preserve is the tree, not one file.

第二个选项是使用rebase,这意味着您可以使它看起来像您所做的更改一样

The second option is to use rebase, which means that you make it like it seems al your changes have been made starting from the latest code on the shared branch.

您使用的命令(同样,在私有分支上):

The command you use (again, while on the private branch):

git rebase sharedbranch

历史树将更改为:

o---1---2---3 (sharedbranch)
 \
  a---b---c (privatebranch)

o---1---2---3 (sharedbranch)
             \
              a'--b'--c' (privatebranch)

因此,如果您给Git一些时间来理解它,并且稍微使用它,您会看到Git模型有多好,ClearCase模型有多破损。

So if you give Git some time to understand it, and use it a little, you'll see how much better is the Git model and how broken the ClearCase model is.

BTW,ClearCase中的邪恶孪生问题根本没有之所以存在于Git中,是因为Git不跟踪Directori es(请相信我,您不需要不需要它。)

BTW, the evil twin problem in ClearCase simply does not exist in Git because Git does not track directories (trust me, you do not need that).

此外,如果您有配置说明,则要复杂一些如果有多个分支,并且您将文件从一个分支迁移到另一个分支,您可能会知道规则在配置规范中的顺序有多重要,以及因为配置规范错误,所以看到文件的旧版本令人沮丧。这是由于ClearCase的基本设计而发生的,而且不用说,Git中不会发生这种废话。

Also, if you ever had a configuration specification, which is a little more complicated with several branches and you migrated files from one branch to the other, you probably know how important the order of the rules in the configuration specification is, and how frustrating is to see old versions of files because the configuration specification is "wrong". That happens in ClearCase due to its base design, and, needless to say, that kind of crap can't happen in Git.

因此,总而言之,Git不会拥有诸如查找合并之类的原始工具,因为它不需要它。它具有实际起作用的高级模型和高级合并模型。与ClearCase(使用CCRC静态视图或动态视图)相比,它闪电般快。

So, to conclude, Git does not have a primitive tool such as "find merge", because it does not need it. It has a superior model and superior merge model which actually works. It is lightning fast compared to ClearCase (CCRC static view or dynamic view, you name it).

ClearCase唯一可以拥有优势的地方就是动态更新视图,但由于键入 git checkout分支的速度比更新配置规范的速度更快,因此也得到了缓解。

The only place ClearCase could have an edge is the instantaneous update of the dynamic view, but that is also mitigated by the fact that you can type faster git checkout branch than you can update the configuration specification.

这篇关于ClearCase与Git版本控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆