将Git存储库迁移到新的TFVC存储库 [英] Migrate Git repository to new TFVC repository

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

问题描述

您如何使用git-tfs将现有的Git存储库镜像/复制到新的TFS 2010 TFVC存储库?现有的Git存储库不是从TFS克隆的。

我需要将源代码从我们的远程/本地Git存储库中的主分支移到新的TFVC存储库中以供后人使用,并在每个发行版上更新为生产。

我试过使用git-tfs来完成这个任务,但它似乎需要开始使用最初从TFS克隆的Git存储库,这是不可能的。我可能会考虑使用git-tf来代替,但我工作的公司是微软的一家商店,我宁愿使用更多面向Microsoft的解决方案,也不会使用因政治原因需要Java的解决方案。

解决方案

您可以通过以下步骤将主分支的所有历史记录从本地回购迁移到新的TFVC团队项目:


  1. 创建一个空的TFVC团队项目

  2. 转到您的本地Repo文件夹,并使用 git-tf checkin --deep 命令检查TFVC团队项目的本地回购。默认情况下,checkin命令将创建一个单一的TFS变更集,用于汇总自Git上一次签入TFS后当前分支所做的所有更改。与 - deep 选项一起使用时,自上次签入TFS后,将为当前分支上的每个Git提交创建TFS变更集。


How do you use git-tfs to mirror/copy an existing Git repository to a NEW TFS 2010 TFVC repository? The existing Git repository was NOT cloned from TFS.

I need to move the source code from our master branch in our remote/local Git repository into a new TFVC repository for posterity sake, and to update it on every release to production.

I've tried to use git-tfs to accomplish this but it appears that it needs to START with a Git repository that was originally cloned from TFS, which is not possible. I might consider using git-tf instead, but the company I work for is a Microsoft shop and I would prefer using a solution that is more Microsoft oriented and not use a solution that requires Java for political reasons.

解决方案

You can migrate all history of main branch from local repo to a new TFVC team project with following steps:

  1. Create an empty TFVC team project
  2. Go to your local Repo folder, and use git-tf checkin --deep command to checkin the local repo to a TFVC team project. By default, the checkin command will create a single TFS changeset for the aggregate of all changes made on the current branch in Git since the last checkin to TFS. When used with the --deep option, a TFS changeset will be created for each Git commit on the current branch since the last checkin to TFS.

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

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