在两个帐户之间将 TFVC 存储库迁移到 Git - 使用 git-tfs

问题描述

我被分配了将存储库从一个 Azure DevOps 组织迁移到另一个组织的任务。

我需要移动的源代码库是 TFVC - 他们希望它也迁移到 Git。

我找到了 git-tfs 工具,它看起来可以完成我需要的一切。 安装该工具后,我按照说明运行以下命令来测试我是否可以连接,并且出现以下问题:

C:\temp>git tfs list-remote-branches https://testpoint.visualstudio.com:8080/tfs/TestPoint2013

TF400324: Team Foundation services are not available from server https://testpoint.visualstudio.com:8080/tfs/TestPoint2013.
Technical @R_183_4045@ion (for administrator):
  Unable to connect to the Remote Server
Unable to connect to the Remote Server
A connection attempt Failed because the connected party did not properly respond after a period of time,or established connection Failed because connected host has Failed to respond 16.107.42.18:8080

我认为它需要某种用户/密码,我发现了这个 -

To clone a TFVC repository on Azure DevOps,you should:

Enable alternate credentials. Go to "My profile"->"Security"-> Enter data and "Enable alternate credentials"
use the command following this pattern (where 'yourLogin' and 'yourPassword' was defined in the prev@R_404_6257@s step) git tfs clone https://dev.azure.com/{organization} $/project/folder  --username=yourLogin --password=yourPassword

不幸的是,启用备用凭据的功能关闭,因此我无法执行上述操作。 我生成一个个人访问令牌并尝试使用它,但它也不喜欢那样。 我也尝试使用 ssh 密钥。我创建了一个密钥,将公钥添加到源 Azure DevOps 帐户,然后将以下内容添加到 .ssh 目录中的配置文件 -

Host ssh.dev.azure.com
  HostName ssh.dev.azure.com
  User git
  IdentityFile ~/.ssh/ado

主机名是否正确?

请注意,使用相同的 ssh 密钥,我可以在相同的 ADO 组织 Git 存储库中执行 Git 克隆。

我缺少什么才能成功连接到 tfs 存储库?

这是 git-tfs 工具的链接 - https://github.com/git-tfs/git-tfs/blob/master/README.md

解决方法

TFVC 存储库位于 Azure DevOps 服务而不是 TFS,Azure DevOps 提供了一个简单的迁移工具来从 Team Foundation 版本控制迁移到 Git。

如果你还想使用 git-tfs 命令,你应该使用以下 URL:

git tfs list-remote-branches https://dev.azure.com/{``your organization}

然后会出现一个帐户选择器,您可以选择要登录的帐户。

查看 github 教程和此文档了解详细步骤。

https://docs.microsoft.com/en-us/azure/devops/learn/git/migrate-from-tfvc-to-git