从ClearCase到现有Git存储库的代码迁移 [英] Code Migration from ClearCase to an Existing Git Repo

查看:140
本文介绍了从ClearCase到现有Git存储库的代码迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ClearCase上有一个项目,该项目已迁移到Git.一些提交是在Git存储库上创建的,与此同时,一些代码更改是在ClearCase上完成的.

I have a project on ClearCase which I have migrated to Git. Some commits were created on the Git repo and at the same time, some code changes were done on ClearCase.

我的Git回购版本为v1.5,ClearCase版本为v1.4(正式版).现在,我们希望将v1.4作为单独的分支迁移到Git,并在v1.5之上进行合并.

My Git repo has v1.5 and ClearCase has v1.4 (production). We now want to migrate v1.4 to Git as a separate branch and also merge it on top of v1.5.

为此,我最好的选择是什么?我应该为v1.4创建一个单独的仓库,然后再从v1.5中创建一个樱桃仓库吗?在这种情况下, git rebase 是否可以提供帮助?

What are my best options for this? Should I create a separate repo for v1.4 and then cherry-pick from v1.5 or can git rebase help in this situation?

推荐答案

您可以在 1.5 之前的版本中在Git中创建分支,然后导入文件.
如果您有一个表示1.4版本的ClearCase视图(快照或动态),则可以转到Git存储库(在新分支中设置),然后:

You can create a branch in Git, from before the 1.5 version, and import your files.
If you have a ClearCase view (snapshot or dynamic) representing the 1.4 versions, you would go to your Git repo (set in the new branch) and:

git --work-tree=/path/to/ClearCase/view add .

与ClearCase视图内容相比,这将自动在Git存储库中添加/更新/删除文件.

That would automatically add/update/remove files in the Git repo compared to the ClearCase view content.

从那里开始,简单的合并就足以更新1.5分支.

From there, a simple merge is enough to update the 1.5 branch.

这篇关于从ClearCase到现有Git存储库的代码迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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