将TFS 2013迁移到Git [英] Migrate TFS 2013 to Git

查看:57
本文介绍了将TFS 2013迁移到Git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在过去的24小时里,我一直在努力解决以下问题.

During the past 24 hours I've been struggling with the following.

由于我们的开发团队使用TFS(当前版本2013)已有相当一段时间,因此我们决定将所有项目迁移到git.

As our dev team uses TFS (current version 2013) for quite some time, we decided to migrate all of the projects to git.

但是不幸的是,这看起来并不容易.首先,我尝试使用git tfs,但是每次我尝试克隆一个集合时,它都会说:

But unfortunately, this doesn't look to be so easy. First of all, I've tried with git tfs, but every time I try to clone a collection it says:

Access to path 'x' denied. 

相反,列出所有分支的过程很顺利.

In contrary, listing all of the branches runs smoothly.

因此,我试图通过尝试将TFS信息库转换为TFS Git信息库来解决这个问题,这将使我可以克隆它并将其推送到我们的BitBucket存储库中.不幸的是,我找不到如何将TFS存储库转换为TFS Git存储库的方法-只是找到了如何创建现有的存储库.

Because of that, I was trying to go the way around by trying to convert a TFS repository into a TFS Git repository which would allow me to clone it and push it to our BitBucket repo. Unfortunately, I cannot find how to convert a TFS repository to a TFS Git repository - only found how to create an existing.

最后但并非最不重要的一点,我什至尝试了git tf-但每次尝试访问我的存储库时,它都说:未找到"Java .... Main.class".

Last but not least, I have even tried with git tf - but every time I try to access my repos it says: "Java....Main.class" not found.

关于如何成功从TFS迁移到Git的任何提示和技巧?

Any tips and tricks onto how to successfully migrate from TFS to Git?

提前谢谢!

推荐答案

TFVC和Git是根本不同的版本控制模型(请参见

TFVC and Git are radically different version control models (see https://en.wikipedia.org/wiki/Version_control for additional information): it is like moving your data from Files&Directory to a Relational DBMS or comparing an electric car to an internal combustion engine.

我的建议是回到基础知识,并明确说明要求.:

My suggestion is going back to the basics and state the requirements clearly. :

  • 我需要迁移所有源代码吗?
  • 我需要迁移历史记录吗?
  • 我需要所有分支机构吗?

我的建议是专注于您真正需要的东西,并寻求最快,最便宜的解决方案,通常是:

My recommendation is to focus on what you really need and go for quickest and cheapest solution which is usually:

  1. 仅将我需要的源文件移至新系统,并清除旧的未使用的东西(称之为车库清洁)
  2. 将旧系统锁定为只读
  3. 拍摄最少分支的快照并将其提交到新系统中(不需要特殊工具)
  4. 请勿在主要版本发布之前进行迁移,请明智地选择时机,以便团队有时间学习新技术并解决问题
  5. 开始使用新系统,并以旧系统为参考

第2项可以通过删除除管理员之外的所有人的权限来实现.我第3步的想法是:克隆空存储库,在单独的TFVC工作区中获取最新的主要分支,将文件同步到Git存储库(例如,robocopy/MIR/XD .git ),提交,推送,创建并将Git切换到分支X,获取最新的TFVC分支X,进行同步等.对要迁移的所有分支重复上述操作.

Item 2 can be implemented by removing permissions to everyone except administrators. My idea of step 3 is: clone empty repo, get latest of main branch in separate TFVC workspace, sync the files to the Git repo (e.g. robocopy /MIR /XD .git), commit, push, create and switch Git to branch X, get latest TFVC branch X, sync, etc. Repeat for all the branches you want to migrate.

还考虑对代码库布局进行一些次要重构,并将其拆分为单独的Git子树甚至子模块.

Consider also some minor refactoring of the code base layout and splitting into separate Git sub-trees or even sub-modules.

这篇关于将TFS 2013迁移到Git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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